Microsoft Command-line Reference

http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/ntcmds.mspx?mfr=true

Advertisements

Creating .zip file with VBScript (internal Windows XP & up feature)

Sub CompressFolderToZip(ByVal FolderPath, ByVal ZipFilePath)

Dim ii, FSO, FilesInLogFolder
Const ForWriting = 2

‘ FolderToZip = “C:\BitmapCPCustomization”
‘ zipFile = “C:\someZipFile.zip”
FolderToZip = FolderPath
zipFile = ZipFilePath

set sa = CreateObject(“Shell.Application”)

Set FSO = CreateObject( “Scripting.FileSystemObject” )
FilesInLogFolder = FSO.GetFolder(FolderPath).Files.Count

‘ Create an empty ZIP file
Set objFSO = CreateObject( “Scripting.FileSystemObject” )
Set objTxt = objFSO.OpenTextFile( zipFile, ForWriting, True )
objTxt.Write “PK” & Chr(5) & Chr(6) & String( 18, Chr(0) )
objTxt.Close
Set objTxt = Nothing

Set zip= sa.NameSpace(zipFile)
Set Fol=sa.NameSpace(FolderToZip)
zip.CopyHere Fol.Items
‘WScript.Sleep 2000
wait 2

While Not sa.NameSpace(zipFile).Items.Count = FilesInLogFolder
Wait 10
Wend

End Sub

Detecting 32bit or 64bit OS in VBscript

http://besidethecursor.integr-8.com/2010/03/detecting-32bit-or-64bit-os-in-vbscript.html

On Error Resume Next

Dim WshShell
Dim OsType

Set WshShell = CreateObject(“WScript.Shell”)

OsType = WshShell.RegRead(“HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\PROCESSOR_ARCHITECTURE”)

If OsType = “x86” then
wscript.echo “Windows 32bit system detected”
elseif OsType = “AMD64” then
wscript.echo “Windows 64bit system detected”
end if