- Community Home
- >
- Servers and Operating Systems
- >
- Legacy
- >
- Windows Server 2003
- >
- Re: vbs script to configure as a login script - pl...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-05-2006 07:17 AM
тАО10-05-2006 07:17 AM
plz help me ... and provide me the code of a vbs script that can run the following command:
netsh interface ip set address name="Local Area Connection" source=dhcp
I have to configure the login script via group policy, in which the "netsh interface ip set ..." command runs, and set the machine, a dhcp client. I try by simply make "abc.vbs" file with the code "netsh interface ip set ...", but when I run/execute the file, it produce compilation error.
Regards
Maaz
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-05-2006 08:01 PM
тАО10-05-2006 08:01 PM
SolutionYou would probably be better off making a .cmd file and putting this in the logon script in group policy.
Simply coy the line :
netsh interface ip set address name="Local Area Connection" source=dhcp
into notepad and save it as LAN.cmd endsuring that you Local Area Connection is actually called Local Area Connection and not something else!
The set up the policy with this file and it should work ok....
:-)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-06-2006 06:44 AM
тАО10-06-2006 06:44 AM
Re: vbs script to configure as a login script - plz help
May I ask one more thing...
abc.vbs is called a "vb script"
abc.bat is called a "batch file/scipt"
what will be abc.cmd called ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-06-2006 10:17 PM
тАО10-06-2006 10:17 PM
Re: vbs script to configure as a login script - plz help
.bat and .cmd are same - no difference in behavior for windows NT/2000/XP/2003
However, windows 95/98 can work only with .bat files and not with .cmd
.BAT = common to x-DOS operating systems (for windows 95/98 for example)
.CMD = used by OS/2 and introduced first in Windows NT4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-07-2006 04:42 AM
тАО10-07-2006 04:42 AM
Re: vbs script to configure as a login script - plz help
Regards
Maaz
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-11-2006 05:29 AM
тАО10-11-2006 05:29 AM
Re: vbs script to configure as a login script - plz help
strCommandLine = Chr(34) & "netsh interface ip set address name=" & Chr(34) & "Local Area Connection" & Chr(34) & "source=dhcp" & Chr(34)
Call ExecuteADOSCommand(strCommandLine)
Sub ExecuteADOSCommand(varCommandLine)
MsgBox varCommandLine
Dim oWshShell
Set oWshShell = CreateObject("WScript.Shell")
oWshShell.Run "%COMSPEC% /c " & Chr(34) & varCommandLine & Chr(34), 1, False
'True - Wait till commandline finishes before continuing through the script.
'False - Do not wait for the commandline finishes before continuing through the script.
'0 Hides the window and activates another window.
'1 Activates and displays a window. If the window is minimized or maximized,
' the system restores it to its original size and position. An application
' should specify this flag when displaying the window for the first time.
'2 Activates the window and displays it as a minimized window.
'3 Activates the window and displays it as a maximized window.
'4 Displays a window in its most recent size and position. The active window remains active.
'5 Activates the window and displays it in its current size and position.
'6 Minimizes the specified window and activates the next top-level window in the Z order.
'7 Displays the window as a minimized window. The active window remains active.
'8 Displays the window in its current state. The active window remains active.
'9 Activates and displays the window. If the window is minimized or maximized, the system
' restores it to its original size and position. An application should specify this flag
' when restoring a minimized window.
Set oWshShell = Nothing
End Sub
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-11-2006 08:04 PM
тАО10-11-2006 08:04 PM
Re: vbs script to configure as a login script - plz help
http://www.microsoft.com/technet/scriptcenter/scripts/default.mspx?mfr=true
Phil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-13-2006 02:44 AM
тАО10-13-2006 02:44 AM
Re: vbs script to configure as a login script - plz help
Dear Mr Phil. Howell thanks for providing the superb resource(url).
Thanks EveryOne.
Regards
Maaz