Page 1 of 3 123 Last
  • Jump to page:
    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2009
    Posts
    14
    Rep Power
    0

    Disable network shutdown script


    Hello everybody,I hope you had a good Christmas and New Year.

    I'm trying to make a script(I think?)
    I want to 'Disable' 1 or all network adapters when shutting down/rebooting.

    I'm trying to do it by going to Group Policy,windows settings,scripts,shutdown.(Not sure if this is the right way)?

    This is where I get lost.
    I'm not sure what to put in the fields?
  2. #2
  3. Automagically Delicious
    Devshed Regular (2000 - 2499 posts)

    Join Date
    May 2004
    Location
    127.0.0.2 - I live next door.
    Posts
    2,200
    Rep Power
    2737
    I'm trying to look into using "netsh" (thanks to ctardi for pointing that command out in the *other* wonderful thread) so give "netsh dump" a try, that dumps the current script/config to the console. That may lead to some clues for you.

    Also, just out of curiosity, why is it you need to do this? Is there an underlying problem? Maybe fixing that would be a better solution. I am also assuming you are using WinXPsp2. Am I wrong in this? Please provide a few additional details so we can answer the correct problem.
    Adam TT
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2009
    Posts
    14
    Rep Power
    0
    To be honest I have no idea what to write or even how to write a script

    XPSP3
    When my network adapter is 'ON/enabled' and I bootup it takes ages for 'windows' to become active.
    (It's always the network adapter)

    When my network adapter is 'Disabled' and I bootup it takes a lot less time for 'windows' to become active.

    If I can disable my network connection/s on shutdown/reboot then every bootup will be quicker.

    I've put a shortcut to network connections into the startup folder so I can enable whichever connection I need when my desktop pops up.

    After researching etc I know this can be accomplished by a 'shutdown' script.
    ......but as I said "I have no idea what to write or even how to write"
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Dec 2006
    Location
    Midnight Train Going Anywhere
    Posts
    1,153
    Rep Power
    1593
    You want to look into a different command line tool called DevCon

    Clickie

    Devcon is basically a command line version of Device Manager.

    Once you have devcon set up (You should find the instructions in the link I provided), create a .bat file with the contents:
    Code:
    devcon.exe disable <deviceID>
    And to enable:
    Code:
    devcon.exe enable <deviceID>
    In windows 2000 or XP Pro (not sure about home) you can do the following:
    run gpedit.msc

    Computer configuration/windows settings/scripts (startup/shutdown)/shutdown

    You should be able to add your first .bat file there, and it will run before your computer shuts down.
  8. #5
  9. Automagically Delicious
    Devshed Regular (2000 - 2499 posts)

    Join Date
    May 2004
    Location
    127.0.0.2 - I live next door.
    Posts
    2,200
    Rep Power
    2737
    OK, I cannot write a full article for you, but I found some very helpful links to give you. Then I've gotta get back to work ( :

    I first found this forum on the old Sysinternals site. They have made a ton of cool and useful tools for windows.....then Microsoft bought them up. Check out their tools for Windows here.

    I then found a link in in that thread to this KB article. It explains some too.

    Try just some normal Google searches for anything revolving around Batch scripts and the command "netsh interface set interface". I hope this helps, I'll check back later and try to give you some more if you still need it.
    Adam TT
  10. #6
  11. Automagically Delicious
    Devshed Regular (2000 - 2499 posts)

    Join Date
    May 2004
    Location
    127.0.0.2 - I live next door.
    Posts
    2,200
    Rep Power
    2737
    Just as I post I realize one more thing I should mention, your question of HOW to write. Just use notepad and open a new file, create a text file with the commands you need written to the console and then save the file as a ".bat" extension. Windows recognizes this and will run it as a "Batch Script". Post back if you'd like this run automatically, or if you'd be OK with running this manually by double-clicking the .bat file from your desktop.
    Adam TT
  12. #7
  13. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2009
    Posts
    14
    Rep Power
    0
    Thanks very much.
    Although everything is as clear as mud still lol

    I'm looking into netsh now,thanks
    I've tried
    netsh interface set interface "mynetworkhere" DISABLED

    but I get an error.....put http at the front....
    ://i89.photobucket.com/albums/k239/indigian/screen1.jpg
    parameter not specified....?

    I want it to run automatically,I won't remember everytime.

    Looking into devcon also,thanks,I'd rather not have to install anything though

    Quote
    "Computer configuration/windows settings/scripts (startup/shutdown)/shutdown

    You should be able to add your first .bat file there, and it will run before your computer shuts down."



    Yes,that's where I'm looking,just need to make the correct bat file or other.

    If I install devcon.....
    REM To list all adapters of any system run the following command:
    REM devcon listclass net

    REM Disable/enable LAN adapter
    devcon disable "PCI\VEN_8086&DEV_101E&SUBSYS_05491014&REV_03"
    devcon enable "PCI\VEN_8086&DEV_101E&SUBSYS_05491014&REV_03"

    I'm not quite there but much closer,many many thanks
  14. #8
  15. No Profile Picture
    Contributing User
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Dec 2006
    Location
    Midnight Train Going Anywhere
    Posts
    1,153
    Rep Power
    1593
    *I* would use devcon, that's just the tool that I know to do it with, I'm sure netsh will work just fine as well, though I haven't attempted.

    Netsh would probably let you do it, though I don't know the command.

    You could then use the bat files as I stated above.

    Have you looked into why it takes so long to boot up with network adaptor enabled? It sounds like it could be malware related to me...something trying to connect to some server on boot...

    Comments on this post

    • AdamPI agrees : Agreed, my first thought, too. Look for the underlying issue; don't just band-aid it.
  16. #9
  17. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2009
    Posts
    14
    Rep Power
    0
    It's a fresh install so no malware etc.

    It ONLY happens when the adapter has an IP.
    Maybe I misled you down the enabled/disabled path inadvertantly,sorry
    Doesn't matter wether it's a DHCP IP or a fixed IP that I gave it.

    The Devcon and bat file looks quite easy to incorparate,I may try it although like I said,I'd rather not install anything.

    Not sure netsh can do what's needed though?

    Thanks Guys,almost there
  18. #10
  19. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2009
    Posts
    14
    Rep Power
    0
    haha
    Downloaded devcon but what do I do with it?
    Do I just drop it int system32 folder?
  20. #11
  21. Automagically Delicious
    Devshed Regular (2000 - 2499 posts)

    Join Date
    May 2004
    Location
    127.0.0.2 - I live next door.
    Posts
    2,200
    Rep Power
    2737
    probably the best place for it. Did you find instructions in the link that ctardi provided? They may help. If you don't find your answer in there I'd probably think that the system32 folder should be good, either that or the root (C:\Windows) that way you can call the program from the command line and not need to specify a full path.
    Adam TT
  22. #12
  23. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2009
    Posts
    14
    Rep Power
    0
    I'm struggling to find my device id...
    I think it's this...
    {1A3E09BE-1E45-494B-9174-D7385B45BBF5}\NVNET_DEV0057\4&25934AEF&0+00

    but
    DEVCON.EXE DISABLE {1A3E09BE-1E45-494B-9174-D7385B45BBF5}\NVNET_DEV0057\4&25934AEF&0+00
    as a bat file does not work.

    It's my inbuilt nvidia ethernet I'm trying to disable.
    I'm also using a RAID0 but shouldn't think that would matter?
  24. #13
  25. No Profile Picture
    Contributing User
    Devshed Regular (2000 - 2499 posts)

    Join Date
    May 2004
    Location
    surfing the interwebz
    Posts
    2,410
    Rep Power
    2005
    Sorry to jump in the middle of the post, but you mentioned you wanted to do this because it takes forever to log onto the domain with your network adapter enabled? Is this by chance a laptop? Usually if it's taking a long time it's a DNS issue. Is there an admin you can speak to at your comapny?(Doug G helped me out with a similar problem, maybe he'll post here).
  26. #14
  27. No Profile Picture
    Contributing User
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Dec 2006
    Location
    Midnight Train Going Anywhere
    Posts
    1,153
    Rep Power
    1593
    If I recall correct, it will be 4&25934AEF&0+00

    I think the format is HardwareID\DeviceID

    If you run the command in command line instead of a batch file, you might get an error message that could be useful.
  28. #15
  29. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2009
    Posts
    14
    Rep Power
    0
    I just tried...
    Devcon disable 4&25934AEF&0+00
    in the command line and here is what I got....

    Microsoft Windows XP [Version 5.1.2600]
    (C) Copyright 1985-2001 Microsoft Corp.

    C:\Documents and Settings\Administrator>Devcon disable 4&25934AEF&0+00
    No devices disabled.
    '25934AEF' is not recognized as an internal or external command,
    operable program or batch file.
    '0+00' is not recognized as an internal or external command,
    operable program or batch file.

    C:\Documents and Settings\Administrator>

    I also get the above if I use ....
    DEVCON DISABLE {1A3E09BE-1E45-494B-9174-D7385B45BBF5}\NVNET_DEV0057\4&25934AEF&0+00



    devcon disable nvidia
    No devices disabled.

    This is what I get when I use....
    devcon listclass net

    Microsoft Windows XP [Version 5.1.2600]
    (C) Copyright 1985-2001 Microsoft Corp.

    C:\Documents and Settings\Administrator>devcon listclass net
    Listing 12 device(s) for setup class "Net" (Network adapters).
    PCI\VEN_11AB&DEV_4362&SUBSYS_058C1462&REV_15\4&33B7D061&0&0058: Marvell Yukon 88
    E8053 PCI-E Gigabit Ethernet Controller
    ROOT\*TUNMP\0000 : Microsoft Tun Mini
    port Adapter
    ROOT\MS_L2TPMINIPORT\0000 : WAN Miniport (L2TP
    )
    ROOT\MS_NDISWANIP\0000 : WAN Miniport (IP)
    ROOT\MS_PPPOEMINIPORT\0000 : WAN Miniport (PPPO
    E)
    ROOT\MS_PPTPMINIPORT\0000 : WAN Miniport (PPTP
    )
    ROOT\MS_PSCHEDMP\0000 : WAN Miniport (IP)
    - Packet Scheduler Miniport
    ROOT\MS_PSCHEDMP\0001 : Marvell Yukon 88E8
    053 PCI-E Gigabit Ethernet Controller - Packet Scheduler Miniport
    ROOT\MS_PSCHEDMP\0002 : NVIDIA nForce Ethe
    rnet - Packet Scheduler Miniport
    ROOT\MS_PTIMINIPORT\0000 : Direct Parallel
    V1394\NIC1394\77C40210DC00 : 1394 Net Adapter
    {1A3E09BE-1E45-494B-9174-D7385B45BBF5}\NVNET_DEV0057\4&25934AEF&0&00: NVIDIA nFo
    rce 10/100/1000 Mbps Ethernet

    C:\Documents and Settings\Administrator>


    So I tried using my Marvell adapter.....
    devcon disable PCI\VEN_11AB&DEV_4362&SUB
    SYS_058C1462&REV_15\4&33B7D061&0&0058

    Microsoft Windows XP [Version 5.1.2600]
    (C) Copyright 1985-2001 Microsoft Corp.

    C:\Documents and Settings\Administrator>devcon disable PCI\VEN_11AB&DEV_4362&SUB
    SYS_058C1462&REV_15\4&33B7D061&0&0058
    PCI\VEN_11AB&DEV_4362&SUBSYS_058C1462&REV_15\4&33B7D061&0&0058: Disabled
    1 device(s) disabled.
    'DEV_4362' is not recognized as an internal or external command,
    operable program or batch file.
    'SUBSYS_058C1462' is not recognized as an internal or external command,
    operable program or batch file.
    The system cannot find the path specified.
    '33B7D061' is not recognized as an internal or external command,
    operable program or batch file.
    '0' is not recognized as an internal or external command,
    operable program or batch file.
    '0058' is not recognized as an internal or external command,
    operable program or batch file.

    C:\Documents and Settings\Administrator>


    It works for my Marvell both enable and disable.


    Do you think it's struggling to disable because it's an active,open ip'd network?
    I wonder if disabling DHCP first and then trying to disable the nvidia?
Page 1 of 3 123 Last
  • Jump to page:

IMN logo majestic logo threadwatch logo seochat tools logo