[Tip] Network profile on Windows (for those who use Notebook)

DBA Geral (instalação, configuração do banco, scripts do Sql*Plus, shell scripts, batch scripts, etc...)
Post Reply
User avatar
dr_gori
Moderador
Moderador
Posts: 5026
Joined: Mon, 03 May 2004 3:08 pm
Location: Portland, OR USA
Contact:
Thomas F. G

Você já respondeu a dúvida de alguém hoje?
https://glufke.net/oracle/search.php?search_id=unanswered

Who uses a notebook should come across the same problem:
* of the day, you are at work (you have to set up your network to work at work)
* At night, you are at home or in the School (you have to set up your network to work there)
* etc ...

On Linux, it's easy! You create a script using the ifconfig and you are ready. But in Windows, I never knew how to do it! Until I discovered Netsh !!!

Create these 2 batch:

creates.bat

Select all

netsh -c interface dump > c:\config_casa.txt 
Perform this script, and it will generate in C: your home settings.

carries_casa.bat

Select all

netsh -f c:\config_casa.txt

Hence, just run the BAT above to load the generated settings.

When you go to your job, set up your network and then change the creation.bat by changing only the file name to C: \ config_tork .txt. Run creates again. It will create the C: \ config_work.txt with the settings of your work.

carries_work.bat

Select all

netsh -f c:\config_trabalho.txt
Now, every time you want to change the profile, just click on the load_xxxx .bat you want !!!

there is an example of config_casa that he created for me:

Select all

#======================== 
# Configura‡Æo da Interface 
#======================== 
pushd interface 
 
reset all 
 
 
popd 
# Final da configura‡Æo de interface 
 
 
 
# ----------------------------------  
# Configura‡Æo de Interface IP                   
# ----------------------------------  
pushd interface ip 
 
 
# Configura‡Æo de interface IP para "ConexÆo de rede local" 
 
set address name = "ConexÆo de rede local" source = static addr = 172.16.3.113 mask = 255.255.255.0 
set address name = "ConexÆo de rede local" gateway = 172.16.3.251 gwmetric = 1 
set dns name = "ConexÆo de rede local" source = static addr = 172.16.2.18 
add dns name = "ConexÆo de rede local" addr = 172.16.2.16 
set wins name = "ConexÆo de rede local" source = static addr = 172.16.2.4 
 
 
popd 
# Final da configura‡Æo de interface IP 
 
User avatar
anderson
Rank: Analista Júnior
Rank: Analista Júnior
Posts: 75
Joined: Mon, 06 Jun 2005 1:08 pm
Location: Toledo - PR
Contact:
Anderson Nuernberg
---

Dude, very show this, I always looked for something like that but I did not find it, congratulations !!!
User avatar
dr_gori
Moderador
Moderador
Posts: 5026
Joined: Mon, 03 May 2004 3:08 pm
Location: Portland, OR USA
Contact:
Thomas F. G

Você já respondeu a dúvida de alguém hoje?
https://glufke.net/oracle/search.php?search_id=unanswered

I discovered that there is a program in Windows named NetSwitcher http://www.netswitcher.com/
with it, you can have multiple network profiles. (Alter even the Explorer and CIA proxy settings)
User avatar
thiagomz
Rank: Estagiário Sênior
Rank: Estagiário Sênior
Posts: 11
Joined: Sun, 27 Jun 2004 10:17 am
Location: Ribeirao Preto SP
Contact:
Att.

Thiago M. Zerbinato
Oracle Certified Professional 8i

I use the IBM Access Connections ... even principle ... but I love scripts: D
Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest