A batch file Logon script can be created in Many languages (VBS File MS-DOS, Powershell, ...). We just understand that it is the client that the session will open that will run this script, it will be able to run it. If you create a Logon Script in Powershell, well ... you are a precursor Powershell is not implemented as a station on 2000, XP or Vista. If you want to do Powershell must be installed on the client machine ...
We will create a simple script file name such logonscript.vbs where we will put the following code
Code:
'************************************************* *****************
'File logonscript.vbs
'Version 1.0
'************************************************* *****************
On Error Resume Next
Set objNetwork = WScript.CreateObject ("WScript.Network)
WScript.Sleep 1000
objNetwork.RemoveNetworkDrive "R"
objNetwork.MapNetworkDrive 'R', '\ \ servername \ sharename'
This simple code in VBScript allows you to map sharing \ \ Servername \ sharename on the network drive R: \ the workstation on which the logon script will run.
Bookmarks