I'm quite new to VBS and I want to start a file from a VBS script. But I've got a problem getting the shell.run to work when I use a String variable.
Set objShell = CreateObject("WScript.Shell")
sNewestFile = "D:\Path with spaces\calendar with spaces.ics"
objShell.Run sNewestFile
If I change it to the actual String instead of the Variable, it works.
Set objShell = CreateObject("WScript.Shell")
objShell.Run """D:\Path with spaces\calendar with spaces.ics"""
I've tested several things with different combinations of "" around the variable but nothing seems to work. Either there is a failure that the System can't find the file or a Compiler error.