metho Posted June 25, 2009 Share Posted June 25, 2009 Hi, I have been working on following batch for over two weeks now after watching Elder-n00b's php scrpit that does the same thing, which i tried but i could get anywhere with it. anyway cut long story short, i got it working (well sort of) using good old MS-DOS batching script. The problem is that i need to change some prameters which will make this script better, to be honest guys, you would be doing me a big favour if you could help me change 2 little things. ;) I'll highlight the bits where i need your help. thanks @echo off echo computer name changer! set /p name=your computername: reg add "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\ComputerName\ActiveComputerName" /v ComputerName /t reg_sz /d %name% /f >nul 2>nul reg add "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Tcpip\Parameters" /v "NV Hostname" /t reg_sz /d %name% /f >nul 2>nul reg add "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Tcpip\Parameters" /v Hostname /t reg_sz /d %name% /f >nul 2>nul echo. echo computername is changed pause > nul echo echo change workgroup name now! set /p name=your workgroupname: [i]"would this work with netdom, would it give me an option where i can specify the workgroup (during the installation/run process of the script) name rather typing below which would stay the same for all the systems."[/i] netdom.exe member /joinworkgroup MSHOME echo work done pause > nul echo set varip=192.168.1.65 "is there a way i can change these last two octets during the run process of the script" set varsm=255.255.255.0 set vargw=192.168.1.254 set vardns1=192.168.1.254 set vardns2=192.168.2.254 ECHO First draft of IP Changer! ECHO Setting IP Address and Subnet Mask netsh int ip set address name = "Local Area Connection" source = static addr = %varip% mask = %varsm% ECHO Setting Gateway netsh int ip set address name = "Local Area Connection" gateway = %vargw% gwmetric = 1 ECHO Setting Primary DNS netsh int ip set dns name = "Local Area Connection" source = static addr = %vardns1% ECHO Setting Secondary DNS netsh int ip add dns name = "Local Area Connection" addr = %vardns2% rem ECHO Here are the new settings for %computername%: rem netsh int ip show config pause echo. is there anyway i can make this script better or incorpate with a different programming Lang i.e. VB. thanks Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.