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.Network")
Set filesys = CreateObject("Scripting.FileSystemObject")
Set shell = CreateObject("WScript.Shell")

'// 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.AddWindowsPrinterConnection printer1
network.AddWindowsPrinterConnection printer2
network.AddWindowsPrinterConnection printer3
network.AddWindowsPrinterConnection 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  
 
programming4us programming4us