Link to home
Start Free TrialLog in
Avatar of WycombeAbbey
WycombeAbbeyFlag for United Kingdom of Great Britain and Northern Ireland

asked on

I need to create a VB Script to query a computer name which would control a copy of a certain .ini file to that referenced computer

Hello
I am a complete novice in vb scripting and I would appreciate some guidance with this one.

What I have is 50 ini files stored in AD each having a slightly different value. A certain ini file then needs to be copied to a PC. i.e PC1a requires PC1a.ini and so on. I could achive this if I sectioned the current OU in to 50 seperate OU's but im sure thats just madness.

I need to have a vb script query the computer name and based on the results copy the appropiate file to that PC's hard drive form AD.

I would appreciate any ideas on this one.

Thank you
Chris
Avatar of James Montgomery
James Montgomery

Well this script references the computer name it is running on, a bit of conditional statements and you should be flying.

http://www.computerperformance.co.uk/Logon/VBScript/VBScript_Windows_getting_started.htm

50 different files seems alot of work, wonder if maybe this can be streamlined?
Avatar of WycombeAbbey

ASKER

Hello JimboEfx
Thank you for the link and im starting to understand how this works. Unfortunately I need more advice in how to end the script in such a way that the computer name once found performs a routine or calls a separate file to copy the correct .ini from AD to that PC based on the computer name output.

        i.e. If Comp Name = PC1 then copy PC1.ini to c:\program files\...

At the moment I do not have the time to learn more scripting and as ever this is becoming a rush job to complete before Christmas.

Any further help would be much appreciated.

Many thanks

Chris

P.S Each of the 50 PC's requires an individual .ini file which references their seat location within the classroom. This helps the staff member to identify the PC when a class is running the software. As its such a small file im happy to run with 50 different ones until I get more time to streamline this.
ASKER CERTIFIED SOLUTION
Avatar of James Montgomery
James Montgomery

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hello Jimbo
Many thanks for that script. This works so Im going to run with it for the moment. I know its not the best way of doing things but this gives me time to work on a more streamed lined version later on.
Regards

Chris