Jump to content

Recommended Posts

Posted

I have been trying to write a script to copy a startmenu to the local drive of a machine from a network share but i need to do it on a room basis.

 

For example

 

If computername begins with A16 then copy a certain start menu from the server

 

Hop someone can help

 

Phil

Posted

I am not 100% sure this will work, as I am just about to try something similar myself, but why not use a GPO in Active Directory?

 

If the computer A16???? is in the A16 OU, for example, edit the GPO for that OU (or create on if it is not already there) go to User Configuration/Windows Settings/Folder Redirection/Start Menu. Right click the Start Menu folder icon.

 

Select setting: 'Basic - Redirect everyone's folder to the same location.

 

Target folder location: 'Redirect to the following location'

 

Root path: Specify a path where the items can be copied from (e.g: \\servername.domain.local\SYSVOL\Common Folders\Start Menus\My A16 Start Menu Items

 

It should work. I am successfully redirecting other items this way. If it doesn't it can easily be undone.

Posted
You want a start up script to copy the start menus to the local machine. You then want to ise the GPO as suggested above to redirect everybodys start menus to something like c:\startmenus\students.
Posted

' ------------------------------------------

' Retrieve OU that the computer resides in -

' ------------------------------------------

 

dim filesys

set filesys=CreateObject("Scripting.FileSystemObject")

 

Dim adstring

adstring = CreateObject("ADSystemInfo").ComputerName

 

Dim oubits

oubits = split(adstring, ",")

 

Dim ou

ou = split(oubits(1), "=")

 

Select Case ou(1)

 

Case "ROOM_NAME"

 

If filesys.FolderExists("c:\sourcefolder\website") Then

filesys.CopyFolder "c:\sourcefolder\website", "c:\destfolder\"

End If

 

End Select

 

'-----------------

 

 

obviously if you want more or have more rooms, just create more case statements with the relevant code chunks , I just did one above as an example and obviously insert the room name inside the quotes of the case.

 

You will have to alter the directory paths for the source and destination of where the start menu folder is. If you just want to copy a file then that will be different.

 

Hope this helps

 

*NOTE* --> However I do recomend you listen to the other suggestion with regards to using GPO and not a vbscript

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...