0

I have a command line code with me.Can any one help to convert the line of code to vbs.The line of code must be executed under oshell.Run command.(wher oshell is the object of WScript.Shell)

The command line code is as follows

 c:\programfiles x(86)\winscp>winscp.com /command "option batch abort" "option confirm off" "open ftps://USERNAME:[email protected]:PORTNUMBER/" "put C:\MyFolder\ForSFTP\TestFile.txt /savefile/" "exit"

Any help will be appreciated

1

1 Answer 1

3

Use CreateObject to create "WScript.Shell" object.

Use "" to escape " inside a string.

Use the help page to see other arguments of Shell.Run method.

Set WshShell = CreateObject("WScript.Shell")
WshShell.Run "c:\program files x(86)\winscp\winscp.com /command ""option batch abort"" ""option confirm off"" ""open ftps://USERNAME:[email protected]:PORTNUMBER/"" ""put C:\MyFolder\ForSFTP\TestFile.txt /savefile/"" ""exit""", 1, True
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.