Last active
April 18, 2023 23:47
-
-
Save rwp0/42ef851f87c21833d3354c6a04d69157 to your computer and use it in GitHub Desktop.
Windows 11 CMD AutoExec Commands
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ echo off | |
rem Save as c:\autoexec.bat | |
color a | |
rem Bright green foreground | |
prompt ^> | |
rem Minimal prompt | |
cls | |
rem Remove copyright banner | |
title CMD %random% | |
rem Minimal title with ID instead of current directory path | |
set DIRCMD=/b | |
rem Minimal "dir" output (list) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Windows Registry Editor Version 5.00 | |
[HKEY_CURRENT_USER\Software\Microsoft\Command Processor] | |
"AutoRun"="call c:\autoexec.bat" | |
; reg import .\autoexec.reg | |
; reg query "HKEY_CURRENT_USER\Software\Microsoft\Command Processor" /v AutoRun | |
; https://superuser.com/questions/1493887/what-is-the-default-registry-value-for-command-processors-autorun | |
; https://www.itprotoday.com/compute-engines/q-how-do-i-add-comments-reg-file | |
; DIDN'T WORK FOR SOME REASON |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ echo off | |
set key="HKEY_CURRENT_USER\Software\Microsoft\Command Processor" | |
reg query %key% /z |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ echo off | |
set key="HKEY_CURRENT_USER\Software\Microsoft\Command Processor" | |
set command=call %systemdrive%\autoexec.bat | |
rem Command used as key value | |
reg add %key% ^ | |
/v "AutoRun" ^ | |
/t REG_SZ ^ | |
/d "%command%" ^ | |
/f |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment