stghelpdesk
asked on
VBS Script to map Q drive to user Profile on remote server
Hi,
I have problem on my citrix servers (XenApp 5), I have Application that need Q drive to map to users Profile under Document and Settings. I tried to write VBS Script to do that (See below Script) Problem I am having is Some users it works but lots of them getting "Bad File Name or Number" also what make it hard for us is we use Tsprofile on our file server for their profile. So Here is script....
Set WshShell = Wscript.CreateObject("Wscr ipt.Shell" )
Set objFSO = WScript.CreateObject("Scri pting.File systemobje ct")
'========================= ========== ========== ========== ========== ========== ========== ========== =========
'The Meat
CWSSub
RunCWS
'========================= ========== ========== ========== ========== ========== ========== ========== =========
' Begin Subs
Sub CWSSub ()
wscript.sleep 2000
WshShell.Run "subst q: /D",0,True
wscript.sleep 2000
WshShell.Run "subst q: %HOMEPATH%",0,True
End Sub
Sub RunCWS()
wscript.sleep 2000
If objFSO.FileExists("c:\CLAI M\BIN\CLAI M.EXE") Then
WshShell.Run "c:\CLAIM\BIN\CLAIM.EXE",0 ,True
Else
MsgBox "c:\CLAIM\BIN\CLAIM.EXE is not a valid path on your system."
End If
End Sub
I have problem on my citrix servers (XenApp 5), I have Application that need Q drive to map to users Profile under Document and Settings. I tried to write VBS Script to do that (See below Script) Problem I am having is Some users it works but lots of them getting "Bad File Name or Number" also what make it hard for us is we use Tsprofile on our file server for their profile. So Here is script....
Set WshShell = Wscript.CreateObject("Wscr
Set objFSO = WScript.CreateObject("Scri
'=========================
'The Meat
CWSSub
RunCWS
'=========================
' Begin Subs
Sub CWSSub ()
wscript.sleep 2000
WshShell.Run "subst q: /D",0,True
wscript.sleep 2000
WshShell.Run "subst q: %HOMEPATH%",0,True
End Sub
Sub RunCWS()
wscript.sleep 2000
If objFSO.FileExists("c:\CLAI
WshShell.Run "c:\CLAIM\BIN\CLAIM.EXE",0
Else
MsgBox "c:\CLAIM\BIN\CLAIM.EXE is not a valid path on your system."
End If
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
(search for rootdrv.cmd)