Networking Forums

Networking Forums > Computer Networking > Windows Networking > Manage OS by VBs

Reply
Thread Tools Display Modes

Manage OS by VBs

 
 
Todd J Heron [MVP]
Guest
Posts: n/a

 
      01-15-2006, 02:48 PM
"Calros Lo" <(E-Mail Removed)> wrote in message...
> Dear everybody I wanna manage my OS or Server System by VBs for example I
> wanna assign my laptop IP address when I'm in >my office , and when I back
> to my home I wanna automatic obtain my IP address by router to Internet I
> don't wanna configure in >manually , i wanna just use a VBs to set my work
> environment quickly , so everybody who can tell me how to write this
> script or tell >me how to get such information,


No need for VBS. You can use one-line netsh commands to switch back and
forth. Short and simple.

When you're in the office, the below command sets the IP address of the NIC
named "Local Area Connection" to 192.168.0.10, subnet mask to 255.255.255.0,
default gateway address to 192.168.0.1 and metric to 10.

netsh interface ip set address "Local Area Connection" static 192.168.0.10
255.255.255.0 192.168.0.1 10

When you need DHCP:

netsh interface ip set address "Local Area Connection" dhcp

--
Todd J Heron, MVP Windows Server - Networking
MCSE - Windows Server 2003/2000/NT; CCA

 
Reply With Quote
 
 
 
 
Ace Fekay [MVP]
Guest
Posts: n/a

 
      01-16-2006, 12:23 AM
In news:(E-Mail Removed),
Todd J Heron [MVP] <todd_heron(delete)@hotmail.com> stated, which I
commented on below:
>
> No need for VBS. You can use one-line netsh commands to switch back
> and forth. Short and simple.
>
> When you're in the office, the below command sets the IP address of
> the NIC named "Local Area Connection" to 192.168.0.10, subnet mask to
> 255.255.255.0, default gateway address to 192.168.0.1 and metric to
> 10.
> netsh interface ip set address "Local Area Connection" static
> 192.168.0.10 255.255.255.0 192.168.0.1 10
>
> When you need DHCP:
>
> netsh interface ip set address "Local Area Connection" dhcp


I actually did something similar for my brother-in-law for his laptop using
WMI. Of course I had a little help from the folks in the VB group and the
private MVP group. Unfortunately it wound up being two separate scripts, one
to run when home, one torun when at work. I didn't pursue it enough because
I don't have enough knowledge writing scripts, to combine them with prompts
asking what part you want run.

For Calros, I got my intial script pieces from
http://cwashington.netreach.net and from teh Script Center at
www.technet.com. The scripts are all free and can be customized. Of course
you can take what Todd suggested and put them into a batch file as well,
place them on your desktop, and double click on them when needed.


--
Ace

This posting is provided "AS-IS" with no warranties or guarantees and
confers no rights.

If you are having difficulty in reading or finding responses to your post,
instead of the website you are using, if I may suggest to use OEx (Outlook
Express or any other newsreader of your choosing), and configure a newsgroup
account, pointing to news.microsoft.com. This is a direct link into the
Microsoft Public Newsgroups, and it is FREE and DOES NOT require a Usenet
account with your ISP. With OEx, you can easily find your post, track
threads, cross-post, and sort by date, poster's name, watched threads or
subject.

Not sure how? It's easy:
How to Configure OEx for Internet News
http://support.microsoft.com/?id=171164

Ace Fekay, MCSE 2003 & 2000, MCSA 2003 & 2000, MCSE+I, MCT, MVP
Microsoft MVP - Windows Server Directory Services
Microsoft Certified Trainer
Assimilation Imminent. Resistance is Futile.
Infinite Diversities in Infinite Combinations.
=================================


 
Reply With Quote
 
Ace Fekay [MVP]
Guest
Posts: n/a

 
      01-16-2006, 02:28 AM
In news:%(E-Mail Removed),
Calros Lo <(E-Mail Removed)> stated, which I commented on below:
> Thank you very much
> But can you tell me where to learn VBs about manage OS or others


I don't know much about VB other than the simple stuff, but if I were you I
would start by reading up on it at some VB websites. I went to Google and
searched for 'learn vb' and got this:
http://www.google.com/search?hl=en&lr=&q=learn+vb

You can also attend courses on it. Microsoft has many courses on VB from
beginner courses to advanced.
This is the main course lookup website at Microsoft. Just click on the
drop-down box and you can see there are multiple courses for multiple
versions of VB.
http://www.microsoft.com/learning/tr...indcourse.mspx

If you want VB Scripting, for example, as it appears that's what you may
want to administer a machine, choose "Microsoft Windows Scripting Host" in
the drop-down box. The result comes up with MOC (Microsoft Official
Curriculum) Course # 2433:
"2433: Microsoft® Visual Basic® Scripting Edition and Microsoft Windows®
Script Host Essentials"

There are also numerous books written on the subject. You can check your
favorite book store. Maybe someone else may have a better suggestion.

Ace


 
Reply With Quote
 
Calros Lo
Guest
Posts: n/a

 
      01-16-2006, 06:12 AM
Dear everybody
I wanna manage my OS or Server System by VBs for example I wanna
assign my laptop IP address when I'm in my office , and when I back to
my home I wanna automatic obtain my IP address by router to Internet
I don't wanna configure in manually , i wanna just use a VBs to set my
work environment quickly , so everybody who can tell me how to write
this script or tell me how to get such information,

PS:I wanna to learn VBs

--
Your Sincerely
YuHsiang Lo , Calros


 
Reply With Quote
 
bournejason
Guest
Posts: n/a

 
      01-16-2006, 02:39 PM
another way to configure 2 ip addresses (1 for home and another for
work) is by using Windows XP feature of Alternate IP addressing.
Here you can configure 2 IP addresses for one NIC. Just go to the NIC's
TCP/IP properties, there are 2 tab's General and Alternate
Configuration.
But nywayz it is always good to learn some scripting tools...

 
Reply With Quote
 
Calros Lo
Guest
Posts: n/a

 
      01-16-2006, 05:06 PM
Thank you very much
But can you tell me where to learn VBs about manage OS or others



"Todd J Heron [MVP]" <todd_heron(delete)@hotmail.com> wrote in message
news:(E-Mail Removed)...
> "Calros Lo" <(E-Mail Removed)> wrote in message...
>> Dear everybody I wanna manage my OS or Server System by VBs for example I
>> wanna assign my laptop IP address when I'm in >my office , and when I
>> back to my home I wanna automatic obtain my IP address by router to
>> Internet I don't wanna configure in >manually , i wanna just use a VBs to
>> set my work environment quickly , so everybody who can tell me how to
>> write this script or tell >me how to get such information,

>
> No need for VBS. You can use one-line netsh commands to switch back and
> forth. Short and simple.
>
> When you're in the office, the below command sets the IP address of the
> NIC named "Local Area Connection" to 192.168.0.10, subnet mask to
> 255.255.255.0, default gateway address to 192.168.0.1 and metric to 10.
>
> netsh interface ip set address "Local Area Connection" static 192.168.0.10
> 255.255.255.0 192.168.0.1 10
>
> When you need DHCP:
>
> netsh interface ip set address "Local Area Connection" dhcp
>
> --
> Todd J Heron, MVP Windows Server - Networking
> MCSE - Windows Server 2003/2000/NT; CCA



 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Manage DHCP with ASP Ant000 Windows Networking 1 03-09-2007 05:50 AM
Manage DHCP with ASP Ant000 Windows Networking 1 03-05-2007 04:52 PM
How to manage port jimmy Windows Networking 1 09-21-2004 05:04 PM
can you remote manage the mn-820> Jimmy Broadband Hardware 1 06-04-2004 06:18 AM
can't get xinetd to manage danted Andrew Schulman Linux Networking 0 07-18-2003 10:31 AM



1 2 3 4 5 6 7 8 9 10 11