Sunday, 15. November 2009, 01:19:48
code, ms-dos, script, developer
...
|
Saudações Amigos,
Em primeiro lugar, gostaria de deixar claro que este Post nasceu de uma necessidade. Atualmente, e cada vez mais frequente para aqueles que possuem notebook ficar pulando de rede em rede, e muitas vezes essas redes exigem algumas configurações especiais, e ficar mudando a cada vez que é necessário se torna algo bem incoveniente. Bom, como eu estava com esse problema, fui em busca de uma solução postei o problema no forum do pplware e encontrei várias soluções e agora lhes trago a resposta de forma resumida.
Bom seguindo, primeiro gostaria de informar que existem dois softwares que fazem isto, são eles:
- Netsetman;
- NetProfiles
Porém, como todo bom programador de que preze, eu gostei mais de desenvolver a solução via Script. Então, depois da dica que recebi no forum do pplware, e de pesquisas consegui desenvolver a funcionalidade em MS-DOS. Veja como ficou:
netsh interface ipv4 set address <nome da rede> <tipo> <ip> <mascara> <gateway> <index>
netsh interface ipv4 set dnsservers <nome da rede> <tipo> <dns> primary
O netsh é um aplicativo disponível em Windows XP e superiores. Agora detalhando o comando, temos: |
| |
| netsh |
- Aplicativo |
| interface |
- Opção do aplicativo |
| ipv4 |
- Opção do aplicativo, e que no caso se refere ao protocolo que você deseja alterar as configurações. |
| set |
- Você deseja setar as configurações |
| address |
- Se refere ao seu endereço no caso IP e tal's. |
| nome da rede |
- Nome da rede que você deseja manipular, no meu caso era a Conexão Local". |
| tipo |
- Você deseja colocar as configurações manualmente (static) ou por DHCP (dhcp). |
| ip |
- IP que deseja atribuir. |
| mascara |
- Mascara que deseja atribuir. |
| gateway |
- Gateway que deseja atribuir. |
| index |
- Não encontrei referência direta, mas imagino que seja para dizer qual o ID (identificação) dele, no caso temos como padrão o valor 1. |
| dns |
- DNS que deseja atribuir. |
| primary |
- Significa que aquele DNS é padrão, o primário. Caso você queira adicionar outro DNS, basta repetir a linha e colocar ao término "secundary" (Não testado). |
| |
|
Veja um exemplo completo:
netsh interface ipv4 set address "Conexão Local" static 10.1.1.3 255.0.0.0 10.1.1.3
netsh interface ipv4 set dnsservers "Conexão Local" static 10.1.1.1 primary
Agora caso você queira deixar o processo legal, basta colocar dentro de um arquivo Batch. Para fazer isso, abra o bloco de notas, cole o seguinte script (modificando os valores necessários) e salve-o com a extensão *.bat* (Exemplo: configRede.bat). Pronto, depois quando você; der duplo clique nele o Windows irá executar e configurar a sua rede.
Veja exemplo de um arquivo Batch:
|
| |
@Echo Iniciando Script ...
@netsh interface ipv4 set address "Conexão Local" static 10.1.1.3 255.0.0.0 10.1.1.3
@netsh interface ipv4 set dnsservers "Conexão Local" static 10.1.1.1 primary
@echo Processo Finalizado.
@pause |
| |
É isso ai pessoal...
Divirtam-se, qualquer coisa é só falar |
Thursday, 29. October 2009, 20:13:01
Brasil, car, wow
Problems with Volkswagen engines 1.0 and 1.6 models Gol, Voyage and Fox reported by owners begin to gain attention from major magazines and newspapers. Discussion on the problems are also now gaining volume in the communities of relationship, which can generate the largest and most expensive Recall of Brazil.
EXAME Magazine published a report which reports that problems in the engines of Gol, Voyage and Fox can cause the largest Recall the history of Volkswagen. An excerpt from the report says: "A company executive and two dealers confirmed that Volkswagen examines the possibility of convening more than 1 million vehicles produced between 2008 and this year, equipped with engines 1.0 and 1.6, to replace parts of the engine . The reason was a defect caused by structural parts that did not receive a heat treatment - which could lead, at worst, an explosion.
According to the Magazine (EXAME), if confirmed this Recall, it is estimated that costs could rise from R$1 billion, because it involves the removal of the motor car, the repair time from more than a day and a complex logistical operation.
This weekend, another report in the Jornal da Tarde and the site of Estadão (SP) with the title "defect mysterious reaches 1.0 engine cars from Volkswagen," reports that Volkswagen admits the existence of a defect in the engines flexible 1.0 EA-111 that affects models such as Gol G5 (new generation), Fox and the Voyage newspaper reports that the brand has yet to identify its source and that a formal opinion will be released in two or three months.
In this report, the reported problem is felt with a constant noise in the engine. In authorized, there has been reduction in the level of oil, and as a result, other problems in several components.
Volkswagen is already aware of 300 cases, all cars equipped with the 1.0 engine, not at all with 1.6. The executive manager of engineering at Volkswagen of Brazil, Joao Alvarez Filho, said the Recall should not happen: "As this is not a defect that compromises the security, we will not recall." FunnySource: Carplace
Translate by: Google Translate
Wednesday, 28. October 2009, 15:04:29
developer, html, code, javascript
I hope they help. This code netted me a few minutes of Web research...
To run the code needs to be ability to ActiveX browser
Enjoy!
function GetPath(){
var MY_COMPUTER = '&H11&';
var WINDOW_HANDLE = 0;
var OPTIONS = 0
try {
objShell = new ActiveXObject("Shell.Application");
objFolder = objShell.BrowseForFolder(WINDOW_HANDLE,"Select Message:",OPTIONS,"C:\");
} catch(e){ alert('Error'); }
if(objFolder == null)
return;
document.getElementById('input1').value = objFolder.Self.Path;
}
Wednesday, 21. October 2009, 09:56:15
Video, wow, youtube, Brasil
Showing posts 1 -
4 of 91.