

Just in case you're interested, I was trying to download files from an FTP site and the commands didn't enter very easily through Wscript.shell so I had to create a batch file that runs "ftp -n -s:Commands.txt". Note: Do not rely on the WshShell.currentdirectory property as I noticed it didn't change the operating directory or maybe I'm doing something wrong. WshShell.Run ("cmd /C """ & OperatingFolderName & "\FTPStartup.bat"""), 1, 1 The solution that helped out in my case was to add a directory change command in the beginnning of the batch file as:Īnd then simply start the batch file with Shell-CMD I was having a similiar problem because the batch file I ran didn't do what it was supposed to so I re-entered the command manually into PowerShell (Installed on later Windows) and it turned out that when the batch file started, it changed the current operatingĭirectory to someplace completely different and it caused issues because the operation needed the working directory to be correct. It can also be errorin before the batch file is launched. You should check for errors by running the VBS from a command prompt. Be sure you rVBS is nnot getting an error.

This is how to debug this kind of problem. Notice the /c is now /K anf th e0 is a 1. Shell.Run "%comspec% /K C:\klitewindowsseven\klcp_full_unattended.bat", 1, True You can also change this line to force the batch file to stay visible. Any critical error can abort teh barch file so fast you may not see it. This will cause the batch file to pause so you can see that it is executing. Tp prove this workse place this command at teh top of the batch file: Open a comamnd prompt and paste it into the window. If you paste this at a command prompt what happens.Ĭ:\klitewindowsseven\klcp_full_unattended.bat

It doesn't state any error messages, I just double click it, and nothing happens, yet the folder copies from the server to the C:\ drive

Just tried and that didn't work either :-(
