it's my first question here on the website.
this is a GIF from my work
i'm work on active mobile numbers on telegram APP.
https://media.giphy.com/media/3ornkbjxXTVIGdfp4c/giphy.gif[
^]
Like you can see in the GIF, i have to move the "tdata" folder and send it to a zip, then rename the zip file by the mobile number i'm working on.
i'm already have a .bat file that it works on move the "tdata" folder to the channels folder and sends it to the ZIP, and give it name "+20" then i rename it and paste the mobile number i have copied.
now i need a command to create the ZIP file with the mobile number i have copied
What I have tried:
this is my .bat file
mkdir C:\Users\elamy\Desktop\Telegram\Channels\tdata
rd "C:\Users\elamy\Desktop\Telegram\tupdates" /s /q
del "C:\Users\elamy\Desktop\Telegram\log.txt" /s /q
move "C:\Users\elamy\Desktop\Telegram\tdata" "C:\Users\elamy\Desktop\Telegram\Channels\tdata\tdata"
"C:\zipper.vbs" "C:\Users\elamy\Desktop\Telegram\Channels\tdata" "C:\Users\elamy\Desktop\Telegram\Channels\+20.zip"
rd "C:\Users\elamy\Desktop\Telegram\Channels\tdata" /s /q
and this is the .vbs zipper file
Set Args = Wscript.Arguments
source = Args(0)
target = Args(1)
' make sure source folder has \ at end
If Right(source, 1) <> "\" Then
source = source & "\"
End If
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set zip = objFSO.OpenTextFile(target, 2, vbtrue)
' this is the header to designate a file as a zip
zip.Write "PK" & Chr(5) & Chr(6) & String( 18, Chr(0) )
zip.Close
Set zip = nothing
wscript.sleep 500
Set objApp = CreateObject( "Shell.Application" )
intSkipped = 0
' Loop over items within folder and use CopyHere to put them into the zip folder
For Each objItem in objApp.NameSpace( source ).Items
If objItem.IsFolder Then
Set objFolder = objFSO.GetFolder( objItem.Path )
' if this folder is empty, then skip it as it can't compress empty folders
If objFolder.Files.Count + objFolder.SubFolders.Count = 0 Then
intSkipped = intSkipped + 1
Else
objApp.NameSpace( target ).CopyHere objItem
End If
Else
objApp.NameSpace( target ).CopyHere objItem
End If
Next
intSrcItems = objApp.NameSpace( source ).Items.Count
wscript.sleep 250
' delay until at least items at the top level are available
Do Until objApp.NameSpace( target ).Items.Count + intSkipped = intSrcItems
wscript.sleep 200
Loop
'cleanup
Set objItem = nothing
Set objFolder = nothing
Set objApp = nothing
Set objFSO = nothing