So I'm really new to this code thing. And i would like to know, how to automatically run commands when command prompt is open. So, what i usually do to run my application is that i open command prompt, the i go >cd desktop then >cd myapp, and then >node atv.js. But i have to do this everytime i need to run my application. Is there any simple way? or is there any way that in order to run those commands i just click on specific icon or folder. Thank you.
Asked
Active
Viewed 1,189 times
2 Answers
1
Sounds like you just need a shortcut.
- Right-click empty space in
C:\Users\<yourUsername>\Desktop\myapp - Choose New → Shortcut
- Enter
node atv.jsand continue - Enter any name you like and finish creating the shortcut
- Move the shortcut to some handy location
- Open shortcut's properties
- In the Start in field enter
C:\Users\<yourUsername>\Desktop\myapp
gronostaj
- 58,482
0
One simple way is to create a batch file, or 2.
Put your commands into first file RunNodeATV.bat
cd desktop
cd myapp
node atv.js
In another batch file (StartRun.bat for example) put the command
Start RunNodeATV.bat
When you execute the StartRun.bat file it will START the RunNodeATV.bat file in a new command window and it will stay open once complete.
Does this help?
Or just create a shortcut to do the script you want if you don't require the command prompt to stay open.