![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Startup-script to change hostname and IP if not OK I have a classrom of computers where I use virtual machines with Linux as host and Win-XP as guests. After copying a VM they will all have the same hostname. I need a startup-script that will set the hostname and IP-adress from a premade INI-file I can store on the Linux-host. Anyone? |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Startup-script to change hostname and IP if not OK "IUnderstandSomething" <hke1972@xxxxxx> schrieb im Newsbeitrag news:5d16f4f0-c690-42fd-b90c-39484f544157@xxxxxx Quote: >I have a classrom of computers where I use virtual machines with Linux > as host and Win-XP as guests. > > After copying a VM they will all have the same hostname. I need a > startup-script that will set the hostname and IP-adress from a premade > INI-file I can store on the Linux-host. > > Anyone? http://stackoverflow.com/questions/5...m-command-line also netsh is good tool: http://www.petri.co.il/configure_tcp_ip_from_cmd.htm you may also try to use DHCP instead of static IP-Nr then no need to change IP settings bye |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Startup-script to change hostname and IP if not OK "IUnderstandSomething" <hke1972@xxxxxx> schrieb im Newsbeitrag news:64b97b9a-2a4c-4fee-9bcd-3e8beb86ff59@xxxxxx Quote: > Almost there ![]() > > I used what you said and read up on a lot of other stuff to and ended > up with this VBS-file: > > Const sName="Class2" > Dim objNet, objShell, strComputerName > Set objNet = CreateObject("WScript.NetWork") > strComputerName = objNet.ComputerName > if sName <> strComputerName then > set objShell = wscript.createObject("wscript.shell") > strTmp = "netsh interface ip set address name 'Local Area Connection' > static 192.168.10.22 255.255.255.0 192.168.10.1" > objshell.run strTmp,1,true > strTmp = "netsh int ip set dns 'Local Area Connection' dns 'Local > Area Connection' static 62.65.30.10" > objshell.run strTmp,1,true > strTmp = "B:\newSid.exe /a " & sName > objshell.run strTmp,1,true > Set objNet = Nothing > end if > > ?? > I am, as you probably can see, trying to test if the computername is > as expected. If not to set IP etc. and DNS. Where I have been guessing > now is at the quates. Because netsh has Local Area Connection in " , > but since I am running it with a shell I thought to change them with > ' , but it does not work. > > Ideas?? > > Thank you! strTmp = "netsh interface ip set address name " & chr(34) & "Local Area Connection" & chr(34) chr(34) stands for " - and I think if you build the string programtically it maybe works hth |
My System Specs![]() |
| | #4 (permalink) |
| | Re: Startup-script to change hostname and IP if not OK On Jul 23, 7:36*pm, IUnderstandSomething <hke1...@xxxxxx> wrote: Quote: > I have a classrom of computers where I use virtual machines with Linux > as host and Win-XP as guests. > > After copying a VM they will all have the same hostname. I need a > startup-script that will set the hostname and IP-adress from a premade > INI-file I can store on the Linux-host. > > Anyone? got? darryl |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Startup Script Via GPO... Where Are Parameters Stored? | VB Script | |||
| Script works / but fails on startup | VB Script | |||
| Shutdown and startup Hyper-V Virtual Machine via script | Virtual Server | |||
| Computer Startup script being terminated, possibly due to a timeout ? | VB Script | |||
| Trivial startup script won't run in Vista | Vista account administration | |||