Microsoft
Software
Hardware
Network
Question : How do i rename mapped drives and printers with the script i have in place
Hi all
im having trouble with a script that is running in a windows server 2003 domain. i have a script starting up in GPO for student log-ins. the script basicaly maps the Drives and printers for the school.
I have a few hidden shares that are mapped and I'd prefer there to be another name that comes up instead of the share name when they goto there computer.
im not very confident at script writing and havent had much exprience with it
here is the script below
--------------------------
----------
----------
-----
'// Declare All variables
Option Explicit
'// Comment this out for debugging!
On Error Resume Next
'// Variables
Dim network, filesys, shell
Dim printer1, printer2, printer3, printer4, serverpath, servername
'// Create Windows Scripting Object
Set network = CreateObject("WScript.Netw
ork")
Set filesys = CreateObject("Scripting.Fi
leSystemOb
ject")
Set shell = CreateObject("WScript.Shel
l")
'// Define UNC Paths
servername = "pvserver"
serverpath = "\\" & servername & "\"
printer1 = serverpath & "Printer1"
printer2 = serverpath & "Printer2"
printer3 = serverpath & "StaffRoom_Colour"
printer4 = serverpath & "Printer4"
'// Dont run on the server!
If LCase(network.ComputerName
) = servername Then
err.Raise 1, "Can not run on the server!"
End If
'// Map Printers
network.AddWindowsPrinterC
onnection printer1
network.AddWindowsPrinterC
onnection printer2
network.AddWindowsPrinterC
onnection printer3
network.AddWindowsPrinterC
onnection printer4
'// Set default printer
network.SetDefaultPrinter printer2
'// map network drives
network.MapNetworkDrive "s:", serverpath & "software"
network.MapNetworkDrive "o:", serverpath & "Pupil Resources"
network.MapNetworkDrive "y:", serverpath & "Media"
network.MapNetworkDrive "t:", serverpath & "Teachers Resources$"
network.MapNetworkDrive "p:", serverpath & "homep$"
network.MapNetworkDrive "z:", serverpath & "Snapshot"
--------------------------
----------
--------
im wanting to be able to call both the mapped drives and printers to anyname i give them rather than the share name
hope some one can help me on this
Many thanks
Phil Croxford
Answer : How do i rename mapped drives and printers with the script i have in place
It's all right, except you have skipped the following answer:
-In jpa code an object myObject becomes detached from a persistence context when you call the method remove(myOjbect) on an instance of EntityManager
Random Solutions
What causes error "0x80070015" when connecting to bluetooth device in window 7?
SBS 2008 shared folder permissions problem - read only - need full control
Insert into MySQL Table from MSSQL Insert Trigger
SQL Server Database Stuck in Single User mode
How to disable use of USB flask drives?
intuitive understanding of the area under the curve - again
Office 2010 MSI GPO Installation
Blackberry Syncing Problem - "No Available Message Stores" error when synchronizing
mcafee EPO script to remove agent and virusscan
Looking for a Font