getting a script to run from a VBA Call Shell correctly

This topic contains 0 replies, has 1 voice, and was last updated by  Lena Margita 3 months, 1 week ago.

  • Author
    Posts
  • #79034

    Lena Margita
    Participant

    The following script runs in PS IDE correctly (identifying info has been changed to generics):

    [code] C:\Lena\WinSCP\WinSCP.com /command 'open ftp://user:pw@sitename.com' 'put ""W:\Master_Library\BUILDERS\WOODSIDE HOMES\THE OVERLOOK\28855.348\28855.348_Rough.PDF"" /sitename.com/Content/PickTicks/' 'exit' [/code]

    The issue becomes just how many quotes do I need to get this same script to run in a VBA Shell call.
    [code]
    Call Shell( _
    "C:\Lena\WinSCP\WinSCP.com /command " & _
    """open ftp://user:pw@sitename.com/"" " & _
    """put """" & RootTarget & """" /sitename.com/Content/PickTicks/"" " & _
    """exit""")
    [/code]

    You can see I currently have """" on each side of the variable holding that path – I have tried a couple of different things including single quotes but nothing seems to be working.

The topic ‘getting a script to run from a VBA Call Shell correctly’ is closed to new replies.