Using wsname to rename based on network file
I think there is a simple solution but I have yet to figure it out. After doing an image install of Windows 7 I have it run wsname in order to rename the computer. My .bat look like:
c:\source\wsname.exe /RDF:"\\"My IP Address"\Kbox\MacAddress to PC Name.txt" /DFK:$SERIALNUM
shutdown -r -t 60
The issue I am running into is that the .bat executes before the computer has time to establish a network connection thus not renaming the machine. If I try to delay the .bat from running by running another .bat before it, the computer will not establish a connection until the .bat files are finished running.
Any suggestions on how I can get a network connection before having kbox run wsname? Or am I missing something completely?
c:\source\wsname.exe /RDF:"\\"My IP Address"\Kbox\MacAddress to PC Name.txt" /DFK:$SERIALNUM
shutdown -r -t 60
The issue I am running into is that the .bat executes before the computer has time to establish a network connection thus not renaming the machine. If I try to delay the .bat from running by running another .bat before it, the computer will not establish a connection until the .bat files are finished running.
Any suggestions on how I can get a network connection before having kbox run wsname? Or am I missing something completely?
0 Comments
[ + ] Show comments
Answers (3)
Please log in to answer
Posted by:
CordlezToaster
14 years ago
Posted by:
CrashnBrn
14 years ago
I have tried various ways of pausing without interaction. The example you gave requires user interaction of hitting the "any key" before the script will continue. I have also tried to have it ping an invalid IP for 2 minutes before running the rest of the script. It seems like the issue is that kbox will not finish loading windows until all the scripts are finished irregardless of how long the pause in the script it. This is my assumption. Basically I need to find a way to let kbox load windows then execute the script, or at least establish a network connection then run the .bat file.
Edit: It just seems like wsname is not working at all as a post-install step in kbox with Windows 7. Has anyone had any luck in running it with Win 7?
Edit: It just seems like wsname is not working at all as a post-install step in kbox with Windows 7. Has anyone had any luck in running it with Win 7?
ORIGINAL: CordlezToaster
Put a pause command in front of it.
so
Pause 60
c:\source\wsname.exe /RDF:"\\"My IP Address"\Kbox\MacAddress to PC Name.txt" /DFK:$SERIALNUM
shutdown -r -t 60
Posted by:
CordlezToaster
14 years ago
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.