Help with VB script
Hi,
I'm a total newbie at this and now my way around VB, I would like to have a script where I drop a folder, I extract the folder name and connect to a NAS where I want it to move this specific folder from one place to another with MV.
I started to make a test, but I get an error on row exec.StdIn.Write(
Suggestions how I can get this to work ?
I'm a total newbie at this and now my way around VB, I would like to have a script where I drop a folder, I extract the folder name and connect to a NAS where I want it to move this specific folder from one place to another with MV.
I started to make a test, but I get an error on row exec.StdIn.Write(
Set objArgs = WScript.Arguments 'WScript.Echo WScript.Arguments.Count myFolder = Split(objArgs(0),"\") intIndex = Ubound(myFolder) WScript.Echo myFolder(intIndex) Set shell = WScript.CreateObject("WScript.Shell") 'run (make it log to XML) shell.Exec("""C:\Program Files (x86)\WinSCP\WinSCP.exe""") ' feed the commands exec.StdIn.Write("option batch abort\n" + "open Nas\n" +"ls /share/HDA_DATA/Test\n" +"exit\n") 'wait until it finishes and collect its output StdOut.ReadAll() 'optionally print the output WScript.Echo(output)
Suggestions how I can get this to work ?