| Author | Messages | |
jsalandra1
Posts:126
 | | 11/05/2008 9:32 AM |
| How do I add in the following bold info into an existing vbs logon script?
On Error Resume Next
Dim objFSO,objFILE,objShell,objNetwork, objWMIService, objItem, colItems, strComputer, objSysInfo, strUserPath, objUser, arrOU, arrUserName, strUserOU, strOUPath, strOSResult, strGroup, strGroupPath, objGroup, arrGroups, strUserPathNEW, objUserNEW, strOUPathNEW, arrUserNameNEW, arrOUNEW, strUserOUNEW
set objFSO=CreateObject("Scripting.FileSystemObject")
set objShell=CreateObject("Wscript.Shell")
set objNetwork=CreateObject("Wscript.Network")
Set objSysInfo=CreateObject("ADSystemInfo")
Set WshShell = WScript.CreateObject("WScript.Shell")
If %systemdrive% = R: then
objNetwork.MapNetworkDrive "K:", \\domain.com\share\grmrpts <file:///\\domain.com\share\grmrpts>
end if
Justin A. Salandra
Network Engineer
jsalandra@transre.com <mailto:jsalandra@transre.com>
------------------------------------------
"IMPORTANT NOTICE: The information in this email (and any attachments hereto) is confidential and may be protected by legal privileges and work product immunities. If you are not the intended recipient, you must not use or disseminate the information. Receipt by anyone other than the intended recipient is not a waiver of any attorney-client or work product privilege. If you have received this email in error, please immediately notify me by "Reply" command and permanently delete the original and any copies or printouts thereof. Although this email and any attachments are believed to be free of any virus or other defect that might affect any computer system into which it is received and opened, it is the responsibility of the recipient to insure that it is virus free and no responsibility is accepted by Transatlantic Reinsurance Company or its subsidiaries or affiliates either jointly or severally, for any loss or damage arising in any way from its use."
| | | |
| ClydeBurns
Posts:19
 | | 11/05/2008 9:42 AM |
| I would replace your 'If then' statement with these 3 lines.
strSystemDrive = WshShell.ExpandEnvironmentStrings("%SystemDrive%") If strSystemDrive = "R:" then objMapNetworkDrive "K:", "\\domain.com\share\grmprts" End if
Clyde Burns
________________________________
From: ActiveDir-owner@mail.activedir.org [mailto:ActiveDir-owner@mail.activedir.org] On Behalf Of Salandra, Justin Sent: Wednesday, November 05, 2008 9:29 AM To: ActiveDir@mail.activedir.org Subject: [ActiveDir] OT: VBS SystemDrive
How do I add in the following bold info into an existing vbs logon script?
On Error Resume Next
Dim objFSO,objFILE,objShell,objNetwork, objWMIService, objItem, colItems, strComputer, objSysInfo, strUserPath, objUser, arrOU, arrUserName, strUserOU, strOUPath, strOSResult, strGroup, strGroupPath, objGroup, arrGroups, strUserPathNEW, objUserNEW, strOUPathNEW, arrUserNameNEW, arrOUNEW, strUserOUNEW
set objFSO=CreateObject("Scripting.FileSystemObject") set objShell=CreateObject("Wscript.Shell") set objNetwork=CreateObject("Wscript.Network") Set objSysInfo=CreateObject("ADSystemInfo") Set WshShell = WScript.CreateObject("WScript.Shell")
If %systemdrive% = R: then
objNetwork.MapNetworkDrive "K:", \\domain.com\share\grmrpts <file:///\\domain.com\share\grmrpts>
end if
Justin A. Salandra
Network Engineer
jsalandra@transre.com <mailto:jsalandra@transre.com>
------------------------------------------
MCSE(rgb) MCTS(rgb)_528_534MCTS(rgb)_1079_1080_1078
"IMPORTANT NOTICE: The information in this email (and any attachments hereto) is confidential and may be protected by legal privileges and work product immunities. If you are not the intended recipient, you must not use or disseminate the information. Receipt by anyone other than the intended recipient is not a waiver of any attorney-client or work product privilege. If you have received this email in error, please immediately notify me by "Reply" command and permanently delete the original and any copies or printouts thereof. Although this email and any attachments are believed to be free of any virus or other defect that might affect any computer system into which it is received and opened, it is the responsibility of the recipient to insure that it is virus free and no responsibility is accepted by Transatlantic Reinsurance Company or its subsidiaries or affiliates either jointly or severally, for any loss or damage arising in any way from its use."
----------------------------------------- This message is confidential, intended only for the named
recipient(s) and may contain information that is privileged or
exempt from disclosure under applicable law. Any patient health
information must be delivered immediately to intended recipient(s).
If you are not the intended recipient(s), you are notified that the
dissemination, distribution or copying of this message is strictly
prohibited. If you receive this message in error, or are not the
named recipient(s), please notify the sender at either the e-mail
address or telephone number above and discard this e-mail. Thank
you. List info : http://www.activedir.org/List.aspx List FAQ : http://www.activedir.org/ListFAQ.aspx List archive: http://www.activedir.org/ma/default.aspx
| | | |
|
|