Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Dim sDest
Dim oShell
Dim oFSO
Dim oArgs
Dim oFolder
Set oArgs = Wscript.Arguments.Named
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oShell = CreateObject("WScript.Shell")
sSource = oArgs.Item("src")
sDest = oArgs.Item("dst")
If sSource = "" or sDest = "" Then
Wscript.echo "zipEachFile.vbs"
Wscript.echo "Zips each file in /src and saves it in /dst"
Wscript.echo "use /src:<some_dir> to specify the location of source files"
Wscript.echo "use /dst:<some_dir> to specify the lcoation to save the zips"
cleanup
End If
If right(sSource,1) <> "\" Then sSource = sSource & "\"
If right(sDest,1) <> "\" Then sDest = sDest & "\"
Set oFolder = oFSO.GetFolder(sSource)
For each oFile in oFolder.Files
zip sSource & oFile.Name, sDest, oFile.Name & ".zip"
Next
Sub CleanUp
If isObject(oArgs) then Set oArgs = Nothing
If isObject(oFSO) then Set oArgs = Nothing
Wscript.Quit
End Sub
Function Zip(source, destination, zipName)
Dim oFSO, oTemp
Dim zipHeader
zipHeader = "PK" & Chr(5) & Chr(6) & String( 18, Chr(0))
Set oFSO = CreateObject("Scripting.FileSystemObject")
wscript.echo "saving " & destination & zipName
Set oTemp = oFSO.OpenTextFile(destination & zipName, 2, True)
oTemp.Write zipHeader
oTemp.Close
If isObject(oTemp) then set oTemp = Nothing
Set oZip = CreateObject("Shell.Application")
oZip.NameSpace(destination & zipName).copyHere source
Set oZip = Nothing
End Function
Windows is a GUI-based OS that happens to have a Command Prompt for some actions... who the hell needs command line stuff?