Batch file needs to be run as administrator to work

Advertisement

rajitha1114@...
Guest

Batch file needs to be run as administrator to work

Hi guys,

When I run my batch script, the cmd window opens & closes. It doesn't download the files.
But when I type the same commands in a command line (Without admin privileges), it executes successfully. And also, when I run the batch file as administrator, it works.
Can someone point me what I am doing wrong? Following is my simple script,

winscp.com /command ^
"open ftp://xxxx:pw@mysite.com/" ^
"option confirm off" ^
"get xpress.zip" ^
"put C:\Boodles\xpress.zip" ^
"get xpress_qb.zip" ^
"put C:\Boodles\xpress_qb.zip" ^
"exit"

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,390
Location:
Prague, Czechia

Re: Batch file needs to be run as administrator to work

Add pause at the end of the batch file to see its output (including any errors).

Reply with quote

rajitha1114
Joined:
Posts:
1
Location:
Sri Lanka

Re: Batch file needs to be run as administrator to work

Hi Martin,

Thank you so much for your response.
Even though I add a pause, it still closes. But surprisingly, it works when run it as admin.
Following is the edited script,

winscp.com /command ^
"open ftp://xxxx:pw@mysite.com/" ^
"option confirm off" ^
"get dkxpress.zip" ^
"put C:\Boodles\dkxpress.zip" ^
"get dkxpress_qb.zip" ^
"put C:\Boodles\dkxpress_qb.zip" ^
pause

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
41,390
Location:
Prague, Czechia

Re: Batch file needs to be run as administrator to work

"at the end of the batch file", not at the end of WinSCP command-line.

winscp.com /command ^
    "open ftp://xxxx:pw@mysite.com/" ^
    "option confirm off" ^
    "get xpress.zip" ^
    "put C:\Boodles\xpress.zip" ^
    "get xpress_qb.zip" ^
    "put C:\Boodles\xpress_qb.zip" ^
    "exit"
 
pause

Reply with quote

Advertisement

You can post new topics in this forum