Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Re: Script issue

Please attach a full session log file showing the problem (using the latest version of WinSCP).

To generate the session log file, use /log=C:\path\to\winscp.log command-line argument. Submit the log with your post as an attachment. Note that passwords and passphrases not stored in the log. You may want to remove other data you consider sensitive though, such as host names, IP addresses, account names or file names (unless they are relevant to the problem). If you do not want to post the log publicly, you can mark the attachment as private.
carbon78

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