Sh M
asked on
WINSCP automate files upload and download by windows scripting to oracle fusion
Hi,
I am not familiar with windows scripting.
- I like to know what is command line in dos prompt for a windows script to do SFTP upload/download from windows to Oracle fusion given domain, user name and password.how can this be automated?
- how to create a bat file for the same script and what is the command line for executing the bat file?
Thanks in advance
I am not familiar with windows scripting.
- I like to know what is command line in dos prompt for a windows script to do SFTP upload/download from windows to Oracle fusion given domain, user name and password.how can this be automated?
- how to create a bat file for the same script and what is the command line for executing the bat file?
Thanks in advance
ASKER
I am working with WINSCP and I can drag and drop file to the remote server without problem.
however I need to write a windows script so that it can be automated later.
I put this script together and run it from the dos prompt. I get no error but I don't see the file being uploaded to the server looking at the winscp GUI interface.
here is what I have done so far:
the test.txt is contains only the following numbers: 123.
this is the upload.bat file:
START:
"C:\Program Files(x86)\Winscp\winscp.e xe" /command "option batch on" "option confirm off" "open userID@example.com" "put C:\Users\User_name\Desktop \text.txt /" "close" "exit"
any idea what happens to the file?
however I need to write a windows script so that it can be automated later.
I put this script together and run it from the dos prompt. I get no error but I don't see the file being uploaded to the server looking at the winscp GUI interface.
here is what I have done so far:
the test.txt is contains only the following numbers: 123.
this is the upload.bat file:
START:
"C:\Program Files(x86)\Winscp\winscp.e
any idea what happens to the file?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Gerwin,
Thanks for your response.
A.
Regarding your first instruction I changed it to from exe to com.
"C:\Program Files(x86)\Winscp\winscp.c om" /command "option batch ......
So it started to search for the host. Asked for password. I entered the password as well:
open userID:password@example.co m"
It started authenticating with pre entered password but it shows:
Access is denied. Authentication failed. No session.
B. I like to try your second suggestion but if you don't mind I focus on getting the first step working.
Thanks for your response.
A.
Regarding your first instruction I changed it to from exe to com.
"C:\Program Files(x86)\Winscp\winscp.c
So it started to search for the host. Asked for password. I entered the password as well:
open userID:password@example.co
It started authenticating with pre entered password but it shows:
Access is denied. Authentication failed. No session.
B. I like to try your second suggestion but if you don't mind I focus on getting the first step working.
ASKER
Correction to previous message:
BudDurland,
Thanks for your response.
A.
Regarding your first instruction I changed it to from exe to com.
"C:\Program Files(x86)\Winscp\winscp.c om" /command "option batch ......
So it started to search for the host. Asked for password. I entered the password as well:
open userID:password@example.co m"
It started authenticating with pre entered password but it shows:
Access is denied. Authentication failed. No session.
Gerwin,
B. I like to try your second suggestion but if you don't mind I focus on getting the first step working.
BudDurland,
Thanks for your response.
A.
Regarding your first instruction I changed it to from exe to com.
"C:\Program Files(x86)\Winscp\winscp.c
So it started to search for the host. Asked for password. I entered the password as well:
open userID:password@example.co
It started authenticating with pre entered password but it shows:
Access is denied. Authentication failed. No session.
Gerwin,
B. I like to try your second suggestion but if you don't mind I focus on getting the first step working.
>> B. I like to try your second suggestion but if you don't mind I focus on getting the first step working.
No problem at all, I've got this working for quite some time with the /script option. Just let me know if you need further assistance.
No problem at all, I've got this working for quite some time with the /script option. Just let me know if you need further assistance.
ASKER
Hi Gerwin,
Could you let me know if I am in the right track:
Created a file named: testsctipt.bat
Contains:
"C:\program files (68x)\ winscp\winscp.com"
/script=c:\users\username\ desktop\my script.txt /log=c:\users\username\ded ktop\log.t xt
Then created a file named mysctipt.txt
It contains:
Option batch abort
Open sftplogin:sftppassword@exa mple.com
Put test.txt /
Exit
Whe I run testscript.bat from dos prompt, it displays:
C:\users\username\desktop\ >"c:\progr am files<86>\winscp.com"
Winscp> _
Basically waits....
?
Could you let me know if I am in the right track:
Created a file named: testsctipt.bat
Contains:
"C:\program files (68x)\ winscp\winscp.com"
/script=c:\users\username\
Then created a file named mysctipt.txt
It contains:
Option batch abort
Open sftplogin:sftppassword@exa
Put test.txt /
Exit
Whe I run testscript.bat from dos prompt, it displays:
C:\users\username\desktop\
Winscp> _
Basically waits....
?
ASKER
Well, ran it for 2nd time and this time it found the host but generated the exact same message as step A I followed initially...
Connection has been unexpectedly closed. Server sent command exit status 0.
Authentication log <see session log for details>:
Using username "my username".
Access denied.
Authentication failed.
Note that I use the exact same username and password to login through winscp GUI without any problem.
Connection has been unexpectedly closed. Server sent command exit status 0.
Authentication log <see session log for details>:
Using username "my username".
Access denied.
Authentication failed.
Note that I use the exact same username and password to login through winscp GUI without any problem.
ASKER
Hello again!
I removed password and it started to work!!!!
When I use GUI it is impossible to connect!
Now the only problem is that I don't see the uploaded file in the GUI screen of winscp. Any suggestion?
I removed password and it started to work!!!!
When I use GUI it is impossible to connect!
Now the only problem is that I don't see the uploaded file in the GUI screen of winscp. Any suggestion?
You are putting the file to / at the destination, can you check there?
I'm changing to the correct folder in the script first (using cd ..) and then getting/putting the file.
I'm changing to the correct folder in the script first (using cd ..) and then getting/putting the file.
ASKER
I don't have access to remote directory and can't create any folder. All I see is the root directory. I assume putting \ means root directory.
ASKER
I assume /test.txt will put the file under the root directory. Right?
You don't have access to the remote directory? How do you want to put files there then?
WinSCP is a secure copy GUI that also has a command line version, are you working with WinSCP already?