Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am tired of typing "cd c:\socket\nodejs" "node testserver.js"

Into the command promt..

How do I create a shortcut or bat for it?

share|improve this question

closed as off topic by Tetrad Oct 25 '12 at 19:39

Questions on Game Development Stack Exchange are expected to relate to game development within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

you create .bat file and write these two lines into it :) – Kikaimaru Oct 24 '12 at 8:33
@Kikaimaru Exactly. You should post this as an answer! – Laurent Couvidou Oct 24 '12 at 8:34
@Laurent Couvidou: I think there are better ways, like automatic restart when you change .js files or running it from webstorm and seeing output in IDE, maybe someone will write some of them in more verbose answer :) – Kikaimaru Oct 24 '12 at 8:40
@Kikaimaru Thank you for the idea of an automatic restart when changed. I will look that up! – Oliver Schöning Oct 25 '12 at 16:39
up vote 0 down vote accepted

To do exactly as you asked, create a .bat file and inside type:

cd c:\socket\nodejs
node testserver.js

But what I would suggest is installing this thing I came across the other day called Lineman. It makes use of Grunt to automatically check for file updates on the fly. It also has built in support for Test'Em which makes unit testing a breeze. Using all of this, you could write a batch script more like this:

cd c:\socket\nodejs
lineman run

then just go from there without even needing to run node periodically. Furthermore, you could create a second batch like so:

cd c:\socket\nodejs
lineman spec

and keep that open so you can check in and make sure all of your unit tests are always passing.

share|improve this answer
Thank you for your answer :) I will look the Lineman up, but probably go with your first answer on how to create a Bat File because I like to check the Client-Side while the server is running, and the Lineman sounds more like a debugger. – Oliver Schöning Oct 25 '12 at 16:38
No problem :) And Lineman can be used as a debugger of sorts but it's really intended for client and server side stuff. Any time you modify any of your js files it essentially "restarts." So you wouldn't need to shut down testserver.js and reboot it every time you modify it. Same goes for any of your other scripts that are run through testserver.js. Glad I could help. – Mike C Oct 25 '12 at 16:41

Not the answer you're looking for? Browse other questions tagged or ask your own question.