Insert route with spaces in visual basic


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

1 answer


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