/build/static/layout/Breadcrumb_cap_w.png

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?

0 Comments   [ + ] Show comments

Answers (3)

Posted by: CordlezToaster 14 years ago
Purple Belt
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
Posted by: CrashnBrn 14 years ago
Senior Yellow Belt
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

Posted by: CordlezToaster 14 years ago
Purple Belt
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
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ