Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.

Windows 7: Start Command Prompt and automatically execute a few commands

23 Feb 2013   #1

Windows 7 Professional 64bit
Start Command Prompt and automatically execute a few commands

I am learning a programming language, and I frequently use command prompt to compile source codes, but every time I start command prompt I need to manually cd to the correct directory, and then I like to run cls to keep the window clean. I have looked around, but I'm not sure how to phrase a google search to get the right results >.<, so could anyone tell me how I would start a command prompt, then run the "cd [location]" and "cls" commands automatically?

My System SpecsSystem Spec
23 Feb 2013   #2
Microsoft MVP

Windows 10 Pro x64 ; Xubuntu x64

I'm not sure that is possible, but Option 2 here might help with the cd/ bit:

Command Prompt
My System SpecsSystem Spec
23 Feb 2013   #3

Windows 7 Professional 64bit

Its not a bad solution, but it would be nice if I could then create a shortcut from that so I can have it pinned to my taskbar.

Thanks for the suggestion :)
My System SpecsSystem Spec


Thread Tools

Similar help and support threads
Thread Forum
Command Prompt Not recognizing commands.
Hi, I'm super sad because I use CMD a lot but its not recognizing regular commands. I have no idea what to do because im more familiar with Terminal on a Macintosh. Thanks.:eek::D
General Discussion
Command prompt not recognizing commands
Hello. It seems as if my command prompt will not let me do any simple system commands such as ping, ipconifg, etc. And it will also not let me use commands for my compiler. The paths are set properly in the environment variables, but it still does not work. See the screencap below: ...
General Discussion
Command prompt doesnt recognize commands / cant repair windows
i cant run any commands in command prompt.i have checked a lot of stuff on inet to solve like paths @environment variables etc but i still couldnt solve it.i thought maybe its cuz a system file is missing made a repair disc but couldnt run sfc via command prompt at boot because i got this error...
BSOD Help and Support
Running command prompt commands elsewhere...
I am trying to configure RightMark Clock Utility to execute the "start" command when the power source for my computer changes. For example, I would want to run this: start /MIN "" "C:Path\to\Program" I am choosing the start command because it gives me the option to use the /min parameter. ...
General Discussion
automatically execute commands when switching to DC
Is there any way I can tell windows to execute various commands when I pull the power adapter from my laptop? For example, I could tell it to close certain background programs that drain battery life or to change the resolution automatically to save power.......
Performance & Maintenance

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd

All times are GMT -5. The time now is 00:45.
Twitter Facebook