I'm trying to modify an old vbs file, I'm running into an issue that has me stumped.
Code:
Dim oShell, oFS, oLocFile, oShortcut, oMacFolder, oEnv, oSig
''''''
Set oFS = CreateObject("Scripting.FileSystemObject")
Set oShell = WScript.CreateObject ("WScript.Shell")
Set oEnv = oShell.Environment("Process")
Set oLocScript = oFS.GetFile (oEnv("userprofile") & "\My Documents\ProgramName\Launchit.vbs")
Set oLocFile = oFS.GetFile (oEnv("userprofile") & "\My Documents\ProgramName\TerminalSessionFile.rsf")
oShell.run oLocFile
So this is a trimmed down version, but basically I want to identify oLocScript and oLocFile as local files, but I have to instruct them to use the user profile. If I replace that and just dump everything into a common C drive folder it works fine. But due to environment restrictions it has to go into my docs. Also, I'm not even sure if oShell.run is going to know how to handle opening this .rsf file.
When I run the code it tells me that File can't be found on Set oLocScript.
I know this isn't a VBscript forum, but any help is always appreciated.