How to Run Automatic Commands in run/cmd window

R

robert

I'd like windows xp to run a bat file (automatically) everytime I open up a
dos window - which I usually do by clicking on a little dos window icon in my
task bar.

Possible?

Thanks,
Robert
 
A

Andrew McLaren

robert said:
I'd like windows xp to run a bat file (automatically) everytime I open up a
dos window - which I usually do by clicking on a little dos window icon in my
task bar.
Possible?


Hi Robert

Yes, this is very possible!

You need to create a Autorun value under the "Command Processor" key in
the registry. Then give this value the name of your batch file (full
path name, eg "C:\Foo\bar\myfile.bat").

You can do this under HKEY\LOCAL_MACHINE to make it apply to all users;
or if you want it only for your own user context, you can define it
under HKEY_CURRENT_USER.

See here for full details:

http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/cmd.mspx?mfr=true

Hope it helps,

Andrew
 
P

Pegasus [MVP]

robert said:
I'd like windows xp to run a bat file (automatically) everytime I open up
a
dos window - which I usually do by clicking on a little dos window icon in
my
task bar.

Possible?

Thanks,
Robert

The shortcut for your Command Prompt currently reads like so:

%systemroot%\system32\cmd.exe

Now modify it like so:

%systemroot%\system32\cmd.exe /k c:\Tools\Robert.bat

That's all there is to it!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top