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?
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Answers

0
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
Answered 08/11/2010 by: CordlezToaster
Purple Belt

Please log in to comment
0
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?

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

Answered 08/12/2010 by: CrashnBrn
Senior Yellow Belt

Please log in to comment
0
Create a post install task that adds the script to either the runonce reg key or the run reg key.
http://social.technet.microsoft.com/Forums/en-US/winserverpowershell/thread/dad3d697-f875-4db4-b32a-fd47e1b93655
Answered 08/15/2010 by: CordlezToaster
Purple Belt

Please log in to comment
Answer this question or Comment on this question for clarity