Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing parameter to Command prompt

Status
Not open for further replies.

vickspills

Programmer
Oct 17, 2018
3
BE
Can somebody help me with this. I am trying to run a command prompt commands using vbscript. I am trying to use parameter but not sure why I am not able to run this.

strfolder= Wscript.Arguments.Item(0)
Set oShell = CreateObject ("WScript.Shell")
oShell.run ""&strFolder&""

The value I am trying to pass is:
strfolder= cmd.exe /C copy c:\folderA\Sourcefile.csv c:\folderB\Destination.csv
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top