Windows Thread, Start Menu Script Problem in Technical; I have been trying to write a script to copy a startmenu to the local drive of a machine from ...
-
23rd November 2006, 01:00 AM #1
- Rep Power
- 13
Start Menu Script Problem
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
-
-
IDG Tech News
-
23rd November 2006, 08:14 AM #2 Re: Start Menu Script Problem
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.
-
-
23rd November 2006, 09:33 AM #3
- Rep Power
- 13
Re: Start Menu Script Problem
The reason that i want to redirect the start menu to a local folder on the machine is so that it runs quicker becuase at the moment it takes a while for the start menu to become useable
-
-
23rd November 2006, 09:49 AM #4 Re: Start Menu Script Problem
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.
-
-
23rd November 2006, 09:50 AM #5 Re: Start Menu Script Problem
' ------------------------------------------
' 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
-
SHARE:
Similar Threads
-
By Andi in forum Network and Classroom Management
Replies: 28
Last Post: 5th December 2007, 02:48 PM
-
Replies: 1
Last Post: 18th October 2007, 04:48 PM
-
By FN-GM in forum Scripts
Replies: 21
Last Post: 17th October 2007, 05:33 PM
-
By iSteve in forum Windows
Replies: 2
Last Post: 9th August 2007, 11:51 AM
-
Replies: 1
Last Post: 12th July 2007, 08:30 AM
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules