Insert route with spaces in visual basic

2

I have this script in visual basic

command = "powershell.exe -nologo -command D:\Google Drive\Share\Scripts\CopySaves.ps1 "

set shell = CreateObject("WScript.Shell")

shell.Run command,0

The problem is that I do not know how to make me take the path of .ps1 because it has a space. Any ideas?

    
asked by Carlos Sánchez 10.02.2017 в 20:21
source

1 answer

3

When we define a route with space in the command line, we need to add double quotes, add those same double quotes to define the route:

command = "powershell.exe -nologo -command ""D:\Google Drive\Share\Scripts\CopySaves.ps1"""
    
answered by 10.02.2017 в 21:32