Unable to find anything specific for this other than spaces in actual file paths. I know I can deal with this by using the actual path and file name enclosed by 3 quotes (inverted commas) but this would have to be changed each time I ran the script. Because thay would be very tedious I need the path and file name to be in the 2 variables as they will be constantly changing
The path will be in var1 and the file name in var2 as follows:
Var1 = "C:\Specials\Blues And Twos\"
Var2 = "Luna Pic.jpg"
Here is the relevent part of my script.
Set shell = CreateObject("WScript.Shell")
shell.Run Var1 & Var2, 1, false
This is no problem running this if there are no spaces iin variables Var1 and Var2. Unfortunately there are in both so how can I get this to run. I know the answer lies in the placing of the quotes so I've tried various combinations but without success.
Any help would be gratefully received.
The path will be in var1 and the file name in var2 as follows:
Var1 = "C:\Specials\Blues And Twos\"
Var2 = "Luna Pic.jpg"
Here is the relevent part of my script.
Set shell = CreateObject("WScript.Shell")
shell.Run Var1 & Var2, 1, false
This is no problem running this if there are no spaces iin variables Var1 and Var2. Unfortunately there are in both so how can I get this to run. I know the answer lies in the placing of the quotes so I've tried various combinations but without success.
Any help would be gratefully received.
My Computer
- Computer type
- PC/Desktop
- OS
- Windows 7 Home Premium 64 bit