Run WinSCP script From bat file as different user

Advertisement

free_hat
Joined:
Posts:
2
Location:
Maidenhead, UK

Run WinSCP script From bat file as different user

Hi, could anybody help me with this please:

I can successfully call a WinSCP script from a bat file like this:
"C:\Program Files (x86)\WinSCP\WinSCP.com" /script="script_file_path.txt"
I can also successfully open a program such as notepad as a different user like this:
runas /user:my_user@my_domain "C:\Windows\notepad.exe"
However I cannot call a WinSCP script as a different user by doing this:
runas /user:my_user@my_domain "C:\Program Files (x86)\WinSCP\WinSCP.com" /script="script_file_path.txt"
When I run the code, it does nothing. It doesn't prompt for a password, open WinSCP or run the script. If I add a pause at the end to see what is on the cmd screen it is a list of prompts and their descriptions for the runas command.

Many thanks in advance.

James

Reply with quote

Advertisement

Advertisement

You can post new topics in this forum