# getting a script to run from a VBA Call Shell correctly

**URL:** <https://forums.powershell.org/t/getting-a-script-to-run-from-a-vba-call-shell-correctly/9315>\
**Category:** PowerShell Help\
**Created:** [September 7, 2017, 2:19pm UTC](https://forums.powershell.org/t/getting-a-script-to-run-from-a-vba-call-shell-correctly/9315 "2017-09-07T14:19:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![txgeekgirl](https://avatars.discourse-cdn.com/v4/letter/t/45deac/32.png) [@txgeekgirl](https://forums.powershell.org/u/txgeekgirl)\
**Post date:** [September 7, 2017, 2:19pm UTC](https://forums.powershell.org/t/getting-a-script-to-run-from-a-vba-call-shell-correctly/9315/1 "2017-09-07T14:19:50Z")

</div>

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

```auto
 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' 
```

The issue becomes just how many quotes do I need to get this same script to run in a VBA Shell call.

```auto
Call Shell( _
    "C:\Lena\WinSCP\WinSCP.com /command " &amp; _
    """open ftp://user:pw@sitename.com/"" " &amp; _
    """put """" &amp; RootTarget &amp; """" /sitename.com/Content/PickTicks/"" " &amp; _
    """exit""")
```

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.

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:38pm UTC](https://forums.powershell.org/t/getting-a-script-to-run-from-a-vba-call-shell-correctly/9315/2 "2024-05-16T20:38:21Z")

</div>


