User not logged in - login - register
Home Calendar Books School Tool Photo Gallery Message Boards Users Statistics Advertise Site Info
go to bottom | |
 Message Boards » » windows command line question Page [1]  
raiden
All American
10505 Posts
user info
edit post

Question:
Is there a way to automate (like a batch file or something) that can be ran at startup to automatically append dns suffix? rather than using the gui everytime the machine reboots?

6/9/2008 11:18:20 PM

evan
All American
27701 Posts
user info
edit post

SET WSHShell = CreateObject("WScript.Shell")
WSHShell.RegWrite "HKLM\System\CurrentControlSet\Services\TCPIP\Parameters\SearchList","your.com,domain.com,list.com,here.com","REG_SZ"


save as something.wsh

voila

[Edited on June 9, 2008 at 11:26 PM. Reason : are you talking about the search list or the connection suffix?]

6/9/2008 11:23:52 PM

raiden
All American
10505 Posts
user info
edit post

connection suffix, got it.

ended up doing more google fu and found a vbscript for it.

thanks for pointing in the right direction though.

6/10/2008 4:27:30 AM

smoothcrim
Universal Magnetic!
18965 Posts
user info
edit post

::~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:://////////////////////////////////////////////////////////|
::%%%%%%%((((( HOSTS Entries and DNS Suffixes )))))%%%%%%%|
::\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\|
::~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Set tempPATH=whereever
Attrib -R %windir%\system32\drivers\etc\HOSTS
echo 127.0.0.1 localhost > %windir%\system32\drivers\etc\HOSTS
echo 127.0.0.1 %computername% >> %windir%\system32\drivers\etc\HOSTS
echo 127.0.0.1 %computername%.demo >> %windir%\system32\drivers\etc\HOSTS
echo 127.0.0.1 %computername%.demo.mydomain >> %windir%\system32\drivers\etc\HOSTS
echo 127.0.0.1 %computername%.demo.mydomain.com >> %windir%\system32\drivers\etc\HOSTS
echo Windows Registry Editor Version 5.00 > %tempPATH%\dnsSuffix.reg
echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters] >> %tempPATH%\dnsSuffix.reg
echo "Domain"="demo.mydomain.com" >> %tempPATH%\dnsSuffix.reg
echo "SearchList"="demo.mydomain.com,mydomain.com" >> %tempPATH%\dnsSuffix.reg
echo "NV Domain"="demo.mydomain.com" >> %tempPATH%\dnsSuffix.reg
REG import %tempPATH%\dnsSuffix.reg

[Edited on June 11, 2008 at 7:22 AM. Reason : probly want to at a del %tempPATH%\*.reg and save as .bat]


[Edited on June 11, 2008 at 7:26 AM. Reason : put an entry in HKLM\Software\Microsoft\Windows\CurrentVersion\Run that calls the bat at login]

6/11/2008 7:21:02 AM

 Message Boards » Tech Talk » windows command line question Page [1]  
go to top | |
Admin Options : move topic | lock topic

© 2024 by The Wolf Web - All Rights Reserved.
The material located at this site is not endorsed, sponsored or provided by or on behalf of North Carolina State University.
Powered by CrazyWeb v2.39 - our disclaimer.