We help IT Professionals succeed at work.

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

Last Modified: 2010-08-05
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
Watch Question

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


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


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


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.
This one is on us!
(Get your first solution completely free - no credit card required)


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.

Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.