cmd - How to run a command on command prompt startup in Windows -
edit
if want perform task @ computer startup or based on event helpful
back question
i have 2 questions:
i want specific commands executed when start command prompt.
e.g.
cls
clear command prompt.i want execute commands in batch file , wait user enter new commands (if any).
e.g. batch file take user specified folder , wait user rename/delete file command prompt.
how can it?
if want defined set of commands run every time start command prompt, best way achieve specify init script in autorun registry value. create (an expandable string value allows use environment variables %userprofile%
):
reg add "hkcu\software\microsoft\command processor" /v autorun ^ /t reg_expand_sz /d "%"userprofile"%\init.cmd" /f
then create file init.cmd
in profile folder:
@echo off command_a command_b ... cls
to remove these changes, delete registry key:
reg delete "hkcu\software\microsoft\command processor" /v autorun
Comments
Post a Comment