Simple CMD line to .bat file switch, help needed

logandiana

Board Regular
Joined
Feb 21, 2017
Messages
107
I am just learning some command line and need help with some syntax when switching to a .bat file.
A high level overview: I am using WinSCP to connect to an Amazon S3 bucket. Then I am copying a file into that bucket.

What currently works:
I open the CMD prompt and enter these lines one by one.

  • "C:\Program Files (x86)\WinSCP\WinSCP.com"

  • open savedS3

  • put "M:\FUTURE\Production\pricingfiles\testdownload.csv" TestUpload.xlsx

  • exit

  • exit

Now I want to create a batch file (.bat) to do the exact same thing, but apparently there are some syntax shifts between the two. The above dropped into a batch file doesn't work.
Any help?
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
As soon as you type "C:\Program Files (x86)\WinSCP\WinSCP.com" you have launched the WinSCP program and are no longer in windows command line environment. "open" and "put" are WinSCP commands not windows batch file commands. You have to write a WinSCP script file and then use the batch file to launch WinSCP and load the script file. See this for a reasonably good explanation:

 
Upvote 0

Forum statistics

Threads
1,215,091
Messages
6,123,062
Members
449,089
Latest member
ikke

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top