ip change

Προβλήματα που αντιμετωπίζουμε χρησιμοποιώντας τα Windows και τα προγράμματά τους. Νέα & ειδήσεις.

Συντονιστές: Super-Moderators, Software & Hardware Moderators

Απάντηση
Άβαταρ μέλους
metalized
Δημοσιεύσεις: 119
Εγγραφή: 29 Αύγ 2005 11:03

ip change

Δημοσίευση από metalized » 12 Σεπ 2005 13:06

loipon...

epsaxna kairo na vrw ena programma poy na moy allazei tin ip sta win xp
grigora.
An exeis ena "peiramatiko" PC tha itheles na toy allazeis tin ip me ena klik.
Epsaxa apo ethw, epsaxa apo ekei... tipota. Thilathi vrika, alla itan shareware, commercial klp...
Opote apofasisa na kanw to thiko moy "programma". Stin oysia einai mono ena batch file poy kalei shell entoles twn XP.
An lavoyme ipopsi oti then exw ithea apo programmatismo, nomizw oti einai kalo. En pasi periptwsi, an sas aresei xrisimopoiiste to, an oxi min to xrisimopoieisete. :) Ithoy:

Κώδικας: Επιλογή όλων

@echo OFF
echo.
echo Welcome to the windows XP easy ip switching program
echo Bellow is the list of the networks you can choose from:
echo ________________________________
echo.
echo 1) Network 1 	
echo			IP/NM	: xxx.xxx.xxx.xxx/25
echo			gateway	: xxx.xxx.xxx.xxx
echo			DNS    	: xxx.xxx.xxx.xxx
echo ________________________________
echo.
echo 2) Network 2	
echo			IP/NM	: yyy.yyy.yyy.yyy/24
echo			gateway	: yyy.yyy.yyy.yyy
echo			DNS    	: yyy.yyy.yyy.yyy
echo ________________________________
echo.
echo 3) DHCP
echo ________________________________
echo.
echo Choose a network by typing a number from 1 to 3 and pressing [ENTER]: 
echo wscript.quit wscript.stdin.readline > ~userin.vbs
cscript.exe //NoLogo //B ~userin.vbs
IF NOT ERRORLEVEL 1 GOTO error
if ERRORLEVEL 4 GOTO error
if ERRORLEVEL 3 GOTO dhcp
if ERRORLEVEL 2 GOTO net2
if ERRORLEVEL 1 GOTO net1
echo.
echo.
:net1
CLS
echo ____________________________________________________________
echo Your choise was 1. This means that your PC will
echo be incorporated to the "Network 1", with static IP.
echo.
echo Your current ip address is:
echo.
ipconfig
echo.
echo Changing your network configuration:
echo IP/NM: xxx.xxx.xxx.xxx/25 - GW: xxx.xxx.xxx.xxx
netsh int ip set address name="Local Area Connection" source=static addr=xxx.xxx.xxx.xxx mask=255.255.255.128 gateway=xxx.xxx.xxx.xxx gwmetric=1
echo Done!
echo.
echo Setting your DNS server:
echo DNS: xxx.xxx.xxx.xxx
netsh int ip set dns name="Local Area Connection" source=static addr=xxx.xxx.xxx.xxx
echo.
echo Your ip setting are the following:
CLS
ipconfig /all
echo.
pause
GOTO End

:net2
CLS
echo ____________________________________________________________
echo Your choise was 2. This means that your PC will
echo be incorporated to the "Network 2", with static IP.
echo.
echo Your current ip address is:
echo.
ipconfig
echo.
echo Changing your network configuration:
echo IP/NM: yyy.yyy.yyy.yyy/24 - GW: yyy.yyy.yyy.yyy/24
netsh int ip set address name="Local Area Connection" source=static addr=yyy.yyy.yyy.yyy mask=255.255.255.0 gateway=yyy.yyy.yyy.yyy gwmetric=1
echo Done!
echo.
echo Setting your DNS server:
echo DNS: yyy.yyy.yyy.yyy
netsh int ip set dns name="Local Area Connection" source=static addr=yyy.yyy.yyy.yyy
echo.
echo Your ip setting are the following:
CLS
ipconfig /all
echo.
pause
GOTO End

:dhcp
CLS
echo ____________________________________________________________
echo Your choise was 3. This means that your PC will
echo be incorporated to the the current network with DHCP.
echo.
echo Your current ip address is:
echo.
ipconfig
echo.
echo Changing your network configuration:
echo Dynamic Host Configuration Protocol
netsh int ip set address name="Local Area Connection" source=dhcp
echo Done!
echo.
echo Setting your DNS server:
echo Dynamic Host Configuration Protocoll
netsh int ip set dns name="Local Area Connection" source=dhcp
echo.
echo Your ip setting are the following:
CLS
ipconfig /all
echo.
pause
GOTO End

:error
CLS
echo.
echo There has been an error. Did you make the correct choice?
echo Your choice should be 1 , 2 , 3  followed by ENTER.
echo.
echo Exiting with no success.
echo.
pause
GOTO End
echo.
echo.

:End
del ~userin.vbs
apla prepei na rithmisete ta thiktia sas (antikatastasi twn xxx kai yyy me tis times toy thiktioy sas).

fisika an kati then paei kala kai aytokatastrafei to PC, svistei o thiskos klp, mi me katigorisete. Shit happens. :lol:

Απάντηση

Επιστροφή στο “Windows Software Guide”

Μέλη σε σύνδεση

Μέλη σε αυτήν τη Δ. Συζήτηση: Δεν υπάρχουν εγγεγραμμένα μέλη και 1 επισκέπτης