Solved

Produce a VBscript that shuts down all networking at log off , then restarting at log on

Posted on 2010-11-16
15
318 Views
Last Modified: 2012-05-10
Hello,
 I have a Windows 7 Ent laptop that is extremely slow when logging in. It sits at the welcome screen for at least 3 to 5 minutes. I wanted to know if there is a way (vbscript) to stop all networking at log off, the once I am logged on to start all the networking services upon log in
.
0
Comment
Question by:charles1040
  • 5
  • 5
  • 2
  • +1
15 Comments
 
LVL 7

Expert Comment

by:rogerard
Comment Utility
A couple things I researched about the windows7 taking a long time to load...  If you have a solid background vs an image can cause it to be delayed.  See:  http://support.microsoft.com/kb/977346.  You can also set a registry key to a shorter network timeout.  The key is:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\
DelayedDesktopSwitchTimeout
You could change to 1, the default is 30.
0
 

Author Comment

by:charles1040
Comment Utility
Hello,


I do not have this key in regedit. i tried to install the hotfix, but it errors out saying that it is not compatible. I believe it has to do with my system trying to find a network. The systems logs on fine only when there are no networks around.
0
 
LVL 7

Expert Comment

by:rogerard
Comment Utility
Ok.  In the meantime, here are some other network related changes to speed up your windows 7..  http://www.sysprobs.com/windows-7-network-slow
0
 
LVL 7

Expert Comment

by:rogerard
Comment Utility
here is a script this is supposed to enable adapters.
 
If WScript.Arguments.length = 0 Then

  Set objShell = CreateObject("Shell.Application")

  objShell.ShellExecute "wscript.exe", """" & WScript.ScriptFullName & """" & " RunAsAdministrator", , "runas", 1

Else

  strComputer = "."

  Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")

  Set colItems = objWMIService.ExecQuery( _

  "SELECT * FROM Win32_NetworkAdapter Where NetEnabled = 'False'")



  For Each objItem in colItems

    Wscript.Echo "Name: " & objItem.Name

    Wscript.Echo "Description: " & objItem.Description

    msgbox objItem.Enable

    Wscript.Echo

  Next  

End If

Open in new window

and his is a link to more information on the win32_networkadapter class
http://msdn.microsoft.com/en-us/library/aa394216%28VS.85%29.aspx
0
 
LVL 66

Expert Comment

by:johnb6767
Comment Utility
Is this a Domain member?
0
 

Author Comment

by:charles1040
Comment Utility
Yes,  I wk from home and do not connect to the network unless I ues a VPN
0
Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

 

Author Comment

by:charles1040
Comment Utility
Yes,  I wk from home and do not connect to the network unless I ues a VPN
0
 
LVL 66

Expert Comment

by:johnb6767
Comment Utility
I think the easiest thing might be to simply unplug the LAN Connection, disable wireless, and not plug them back in/enable them until you are logged in..... Beats having to worry about services.....
0
 

Author Comment

by:charles1040
Comment Utility
Yea true, but that defeats the purpose of a docking station
0
 
LVL 7

Expert Comment

by:rogerard
Comment Utility
I think I may have found a different avenue, based on the information in this post:
http://www.experts-exchange.com/OS/Miscellaneous/Q_20708207.html
and this article:
http://support.microsoft.com/?kbid=311272

If you will post your device information that looks similar to this,

PCI\VEN_8086&DEV_1229&SUBSYS_00408086&REV_0C\3&61AAA01&0&48

I will write the batch files to launch when you logon/logoff.
0
 

Author Comment

by:charles1040
Comment Utility
Hello,


This is the info you requested.

PCI\VEN_8086&DEV_10EA&SUBSYS_04101028&REV_05
        PCI\VEN_8086&DEV_10EA&SUBSYS_04101028
        PCI\VEN_8086&DEV_10EA&CC_020000
        PCI\VEN_8086&DEV_10EA&CC_0200
    Compatible ID's:
        PCI\VEN_8086&DEV_10EA&REV_05
        PCI\VEN_8086&DEV_10EA
        PCI\VEN_8086&CC_020000
        PCI\VEN_8086&CC_0200
        PCI\VEN_8086
        PCI\CC_020000
        PCI\CC_0200
0
 
LVL 7

Accepted Solution

by:
rogerard earned 500 total points
Comment Utility
If you haven't already, download the devcon package located here:
http://download.microsoft.com/download/1/1/f/11f7dd10-272d-4cd2-896f-9ce67f3e0240/devcon.exe
extract it to a temp location then move the file from \i386\devcon.exe to C:\DevCon\devcon.exe

In the same folder as you placed devcon.exe, create file name Disable.bat and put this in it:
devcon disable *DEV_10EA*SUBSYS_04101028*

Open in new window


Create another file named Enable.bat and put this in it:
devcon enable *DEV_10EA*SUBSYS_04101028*

Open in new window


Now, follow the directions at this site,
http://techsupt.winbatch.com/ts/T000001048F90.html
to set these batch files to run.  Ensure that Enable.bat is set to run at logon and Disable.bat at logoff for the Users policy.

Good luck!
0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
Comment Utility
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

INTRODUCTION The purpose of this document is to demonstrate the Installation and configuration of the Data Protection Manager product. Note that this demonstration was prepared on the basis of Windows OS is 2008 R2 and DPM 2010. DATA PROTECTI…
Citrix XenApp, Internet Explorer 11 set to Enterprise Mode and using central hosted sites.xml file.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now