Script issue
Totally new to this...
I have been testing a script on a windows pC. However, once i set up the script on a windows 2008 r2 server it bugs out...
Here is my script, called upload.txt
option batch abort
option confirm off
open sftp://user:password@user.sftp.site.com/ -hostkey="ssh-rsa 2047 xxxxxxxxxxxxxxxxxxxxx
"
lcd D:\RACKSPACE\PUSH\commercehub\
cd /incoming/inventory/dsg
put *.inventory
exit
Here si the bat file
"C:\Program Files (x86)\WinSCP\winscp.com" /ini=nul /script=C:\Users\administrator\Desktop\batch\script\uploadt.txt
ForFiles /p D:\RACKSPACE\PUSH\commercehub\ /d -3 /c "cmd /c del *.inventory"
pause
This script works on windows 10 pc, but not on windows 2008 R2. I am also seeing this
Ambiguous command ''. Possible matches are: !, ascii, binary, bye, call, cd, che
cksum, chmod, close, cp, dir, echo, exit, get, help, keepuptodate, lcd, lls, ln,
lpwd, ls, man, mget, mkdir, mput, mv, open, option, put, pwd, recv, rename, rm,
rmdir, send, session, stat, symlink, synchronize
Not sure why.
Any input will be appreciated.
Thanks,
Dave
I have been testing a script on a windows pC. However, once i set up the script on a windows 2008 r2 server it bugs out...
Here is my script, called upload.txt
option batch abort
option confirm off
open sftp://user:password@user.sftp.site.com/ -hostkey="ssh-rsa 2047 xxxxxxxxxxxxxxxxxxxxx
"
lcd D:\RACKSPACE\PUSH\commercehub\
cd /incoming/inventory/dsg
put *.inventory
exit
Here si the bat file
"C:\Program Files (x86)\WinSCP\winscp.com" /ini=nul /script=C:\Users\administrator\Desktop\batch\script\uploadt.txt
ForFiles /p D:\RACKSPACE\PUSH\commercehub\ /d -3 /c "cmd /c del *.inventory"
pause
This script works on windows 10 pc, but not on windows 2008 R2. I am also seeing this
Ambiguous command ''. Possible matches are: !, ascii, binary, bye, call, cd, che
cksum, chmod, close, cp, dir, echo, exit, get, help, keepuptodate, lcd, lls, ln,
lpwd, ls, man, mget, mkdir, mput, mv, open, option, put, pwd, recv, rename, rm,
rmdir, send, session, stat, symlink, synchronize
Not sure why.
Any input will be appreciated.
Thanks,
Dave