![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| Windows Vista™ Ultimate x64 | Make a command prompt run a command as soon as it opens? Hey guys. Ive been trying to figure out how to make a command prompt run a command line as soon as the box comes up. I need this to happen all from one command line. A command prompt needs to open with "echo hi" being ran as a command line. Any ideas? Thanks |
My System Specs![]() |
| | #2 (permalink) |
| Vista x64 Ultimate SP2, Windows 7 Ultimate x64 | Re: Make a command prompt run a command as soon as it opens? Hello Fmjc001, You could create a BAT file for this. Just type in the commands into a TXT file, then rename the file extension to BAT. When you run the BAT file it will run the commands in a command prompt automatically. Hope this helps, Shawn |
My System Specs![]() |
| | #3 (permalink) |
| Windows Vista™ Ultimate x64 | Re: Make a command prompt run a command as soon as it opens? Hello Fmjc001, You could create a BAT file for this. Just type in the commands into a TXT file, then rename the file extension to BAT. When you run the BAT file it will run the commands in a command prompt automatically. Hope this helps, Shawn |
My System Specs![]() |
| | #4 (permalink) |
| Vista x64 Ultimate SP2, Windows 7 Ultimate x64 | Re: Make a command prompt run a command as soon as it opens? You might need to talk to your administrator then to see what he/she can do for you about possibly allowing this. |
My System Specs![]() |
| | #5 (permalink) |
| Windows Vista™ Ultimate x64 | Re: Make a command prompt run a command as soon as it opens? |
My System Specs![]() |
| | #6 (permalink) |
| Vista x64 Ultimate SP2, Windows 7 Ultimate x64 | Re: Make a command prompt run a command as soon as it opens? I hope the administrator will allow you. |
My System Specs![]() |
| | #7 (permalink) |
| Premium 32bit SP1 | Re: Make a command prompt run a command as soon as it opens? This reminds me of a "virus" that was popular before. Whenever a command prompt was opened, even in safe mode, cmd.exe would exicute a bat file, causing Windows to shut down. Here is how its done. (I trust this will be used for good, not evil.) First create a bat file containing the command you wish to run. Then, in the registry, navigate to HKEY_CURRENT_USER\Software\Microsoft\Command Processor and create a string named autorun and give it the value of where your bat file is located. For example C:\mybat.bat To remove this functionality, delete the autorun string in the registry. |
My System Specs![]() |
| | #8 (permalink) |
| Windows Vista™ Ultimate x64 | Re: Make a command prompt run a command as soon as it opens? This reminds me of a "virus" that was popular before. Whenever a command prompt was opened, even in safe mode, cmd.exe would exicute a bat file, causing Windows to shut down. Here is how its done. (I trust this will be used for good, not evil.) First create a bat file containing the command you wish to run. Then, in the registry, navigate to HKEY_CURRENT_USER\Software\Microsoft\Command Processor and create a string named autorun and give it the value of where your bat file is located. For example C:\mybat.bat To remove this functionality, delete the autorun string in the registry. |
My System Specs![]() |
| | #9 (permalink) |
| Premium 32bit SP1 | Re: Make a command prompt run a command as soon as it opens? From what I have experienced, yes. It does not matter how many you open, or the circumstances that started cmd.exe. Meaning that even if the command prompt was launched directly, through another program, from a shortcut or through the run dialog, it will always run whatever was put in the registry. |
My System Specs![]() |
| | #10 (permalink) |
| Windows Vista™ Ultimate x64 | Re: Make a command prompt run a command as soon as it opens? From what I have experienced, yes. It does not matter how many you open, or the circumstances that started cmd.exe. Meaning that even if the command prompt was launched directly, through another program, from a shortcut or through the run dialog, it will always run whatever was put in the registry. Although, why did it run a shutdown command? It would have been much more fun to kill the wininit.exe :P |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| How to make a batch file on starting and stopping services from command prompt ? | General Discussion | |||
| Command prompt "COPY" command not working in brand new Windows Vis | Vista file management | |||
| DVD Command Prompt | Vista installation & setup | |||
| Vista RC1 install error, stops 1/2 way and opens command a prompt | Vista installation & setup | |||
| Vista RC1 install error, stops 1/2 way and opens command a prompt | Vista installation & setup | |||