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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

shell.run is not running

Status
Not open for further replies.

tadams19

IS-IT--Management
Jul 31, 2009
1
US
I am trying to run an ftp from a VBscript. The syntax I create can run as a .bat file or straight from a command line but not the way it is coded. What is wrong?

As coded:
Set objShell = CreateObject( "wScript.Shell" )

objShell.Run "ftp -vn -s:" & strFTPScriptFileName & " " & strFTPServerName & " >k:\week\prevc405_ftp.log", 0, True

With variables resolved:
objshell.Run "ftp -vn -s:k:\week\FTP_MF_FTP.txt xxxxprod.dmno.com >k:prevc405_ftp.log", 0, True

TIA
 
I do not know the specific answer. From previous dealings with the .run command, I remember that sometimes there needed to be double quotes in some cases.

The best troubleshooting step you could try might be to set the line you are trying to run to a variable and then verify what exactly is being passed to the .run command.

Good luck.
 
Does it just 'not run', or do you get an error that could help us diagnose your problem?

HarleyQuinn
---------------------------------
Black coat, white shoes, black hat, cadillac. The boy's a timebomb!

You can hang outside in the sun all day tossing a ball around, or you can sit at your computer and do something that matters. - Eric Cartman

Get the most out of Tek-Tips, read FAQ222-2244: How to get the best answers before post
 
Just taking a quick look at this, you seem to be trying to ask cmd.exe to do output redirection (using [tt]>somefilename[/tt]) but you aren't running cmd.exe in the first place.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top