matth12582
MIS
Admin Batch Junkie new to VBScript, trying to evolve
was having issues with this segment in a larger script, so pulled it out to isolate it
getting a "cannot find file specified" on my string "StrDir"
when I Wscript.Echo the string it looks correct
i've tried adding & "\" to the end of the path, and even played around with chr(34)
but I'm hoping someone can point me in the right direction
----------------------
was having issues with this segment in a larger script, so pulled it out to isolate it
getting a "cannot find file specified" on my string "StrDir"
when I Wscript.Echo the string it looks correct
Code:
\\meta05\c$\documents and settings\amis5235
i've tried adding & "\" to the end of the path, and even played around with chr(34)
but I'm hoping someone can point me in the right direction
----------------------
Code:
Set WSHShell = CreateObject("Wscript.Shell")
Set objFS1 = CreateObject("Scripting.FileSystemObject")
server = "meta05"
profile = "amis5235"
'NT
StrDir = "\\" & server & "\c$\documents and settings\" & profile
'WIN7
'StrDir = "\\" & server & "\c$\users\" & profile
If objFS1.FolderExists(StrDir) Then
'Wscript.echo strdir
WshShell.Run strdir
ELSE
END IF