cmd - How to run a command on command prompt startup in Windows -


edit

if want perform task @ computer startup or based on event helpful

http://answers.microsoft.com/en-us/windows/forum/windows_7-performance/how-to-schedule-computer-to-shut-down-at-a-certain/800ed207-f630-480d-8c92-dff2313c193b


back question

i have 2 questions:

  1. i want specific commands executed when start command prompt.

    e.g. cls clear command prompt.

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

Popular posts from this blog

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -

asp.net mvc - breakpoint on javascript in CSHTML? -