VBScript command prompt full tutorial code example

Example: vbscript cmd

' This is specifically for VBScripts/VBA/Visual Basic

'EXAMPLE: to run in cmd [rename "C:\Users\JacquesK\JacquesKempty.txt" "RenamedRandomFile.txt"]
dim sInstr as string
sInstr = “rename ""C:\Users\JacquesK\JacquesKempty.txt"" ""RenamedRandomFile.txt"" ” 'note: the " in cmd must be shown with "" in this string
Call Shell("cmd.exe /S /C"&sInstr)

'SYNTAX
'dim sInstr as string
'sInstr = “<your-command>” 'note: the " in cmd must be shown with "" in this string
'Call Shell("cmd.exe /S /C"&sInstr)

Tags:

Vb Example