Skip to content

Instantly share code, notes, and snippets.

@rwp0
Last active April 18, 2023 23:47
Show Gist options
  • Save rwp0/42ef851f87c21833d3354c6a04d69157 to your computer and use it in GitHub Desktop.
Save rwp0/42ef851f87c21833d3354c6a04d69157 to your computer and use it in GitHub Desktop.
Windows 11 CMD AutoExec Commands
@ 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)
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
@ echo off
set key="HKEY_CURRENT_USER\Software\Microsoft\Command Processor"
reg query %key% /z
@ 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