Riddlemd

New Member
Joined
Feb 10, 2013
Messages
2
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
 


Solution
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...
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.
 


Last edited:
Solution
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
 


Last edited:
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.
 


Last edited:
Back
Top