Windows 7 Sript to Enable Network Discovery

Discussion in 'Programming and Scripting' started by Riddlemd, Feb 10, 2013.

  1. Riddlemd

    Riddlemd New Member

    Joined:
    Feb 10, 2013
    Messages:
    2
    Likes Received:
    0
    I would like to create a bat file that will enable Network Discovery, disable sleep or hibernation, enable autologon for the administrator, and change the desktop image... Any help would be greatly appreciated...

    Thanks,
    Mike
     
  2. kaos

    kaos Senior Member

    Joined:
    May 9, 2011
    Messages:
    1,747
    Likes Received:
    33
    save as "anything u want".bat

    NETWORK DISCOVERY - YOU MUST RUN AS ADMINISTRATOR


    @echo off
    cls
    :start
    ECHO Please select a command from the list below
    echo.
    echo.
    ECHO 1) Enable Network Discovery
    ECHO 2) Disable Network Discovery

    set choice=
    set /p choice=Please enter the command number :
    IF NOT '%Choice%'=='' SET Choice=%Choice:~0,9%
    if '%choice%'=='1' goto enable
    if '%choice%'=='2' goto disable

    :enable
    netsh advfirewall firewall set rule group="network discovery" new enable=yes
    cls
    Echo Network Discovery Enabled
    ping localhost -n 2 >nul
    goto start

    :disable
    netsh advfirewall firewall set rule group="network discovery" new enable=no
    cls
    Echo Network Discovery Disabled
    ping localhost -n 2 >nul
    goto start

    (if you require this script as a .exe file then i can sort this out for you.
     
    #2 kaos, Feb 26, 2013
    Last edited: Feb 26, 2013
  3. kaos

    kaos Senior Member

    Joined:
    May 9, 2011
    Messages:
    1,747
    Likes Received:
    33
    HIBERNATION ENABLE/DISABLE - MUST RUN AS ADMINISTRATOR

    @echo off
    cls
    :start
    ECHO Please select a command from the list below
    echo.
    echo.
    ECHO 1) Enable hibernation
    ECHO 2) Disable hibernation
    set choice=
    set /p choice=Please enter the command number :
    IF NOT '%Choice%'=='' SET Choice=%Choice:~0,9%
    if '%choice%'=='1' goto enable
    if '%choice%'=='2' goto disable

    :enable
    powercfg /hibernate on"
    cls
    Echo Hibernation Enabled
    ping localhost -n 2 >nul
    goto start

    :disable
    powercfg /hibernate off"
    cls
    Echo Hibernation Disabled
    ping localhost -n 2 >nul
    goto start
     
    #3 kaos, Feb 26, 2013
    Last edited: Feb 26, 2013
  4. kaos

    kaos Senior Member

    Joined:
    May 9, 2011
    Messages:
    1,747
    Likes Received:
    33
    WALLPAPER CHANGE - MUST RUN AS ADMINSITATOR

    @echo off
    cls
    :start
    reg add "HKCU\Control Panel\Desktop" /v Wallpaper /f /t REG_SZ /d "PATH OF YOUR PICTURE HERE!"
    exit

    note : you must restart your pc in order for the changes to take effect



    by the way, as for you automated login for the adminsitrator, i wouldnt recommend it, it would probly end in tears if ure storing the password in plain text for the batch file.
     
    #4 kaos, Feb 26, 2013
    Last edited: Feb 26, 2013
  5. Davidctv

    Davidctv Member

    Joined:
    Nov 2, 2015
    Messages:
    12
    Likes Received:
    0
    Very intersting but is it possible to do the same thing in windows 10 ?
    Thanks
    David
     

Share This Page

Loading...