avineshp
asked on
Script to change PC Name by querying list
Hi All,
Need to some help to create a script that can change the pc name automatically. I can currently do this with no problem but only if I put the new pc name in the script. I want to be able to have one main text (or access database) where all the pc names are listed for each site (grouped by default gateway), then when the script runs it looks at the pc's current default gateway then queries the master file (txt or db) and then picks the next pc name in the list according to the default gateway.
I know thats a lot there, and hope I explained it fine.
Please help.
Thanks
Need to some help to create a script that can change the pc name automatically. I can currently do this with no problem but only if I put the new pc name in the script. I want to be able to have one main text (or access database) where all the pc names are listed for each site (grouped by default gateway), then when the script runs it looks at the pc's current default gateway then queries the master file (txt or db) and then picks the next pc name in the list according to the default gateway.
I know thats a lot there, and hope I explained it fine.
Please help.
Thanks
ASKER
Hi AmazingTech,
The script works nearly perfectly, Just one problem:
when I run it it just waits for a date to be entered manually (found this out when, I run it, it just stops at a point, then if I go to the UsedComputerNames.txt file I see the below:
The system cannot accept the date entered.
Enter the new date: (yy-mm-dd)
after i type in the date, it works perfectly, why would it do this?
Thanks again for the help, after this problem, this script will be perfect.
The script works nearly perfectly, Just one problem:
when I run it it just waits for a date to be entered manually (found this out when, I run it, it just stops at a point, then if I go to the UsedComputerNames.txt file I see the below:
The system cannot accept the date entered.
Enter the new date: (yy-mm-dd)
after i type in the date, it works perfectly, why would it do this?
Thanks again for the help, after this problem, this script will be perfect.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Excellent script, thanks for your help again.
Change these variables to something accessible on the workstation. Could be server share.
Set NewCompList=C:\AT\NewCompu
Set UsedCompList=C:\AT\UsedCom
Set ErrorLogging=C:\AT\Errors.
Open in new window
NewComputerNames.txt