How do I configure a batch file to be run as a Scheduled Task? [on hold]
up vote
2
down vote
favorite
I have a batch file called index.bat
, which runs the following command:
node index.js
I tried to configure the file to be run on start up using schedule task manager and but it did not work as expected. What do I do?
command-line batch-file windows-task-scheduler
put on hold as unclear what you're asking by LPChip, fixer1234, Toto, PeterH, G-Man yesterday
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
add a comment |
up vote
2
down vote
favorite
I have a batch file called index.bat
, which runs the following command:
node index.js
I tried to configure the file to be run on start up using schedule task manager and but it did not work as expected. What do I do?
command-line batch-file windows-task-scheduler
put on hold as unclear what you're asking by LPChip, fixer1234, Toto, PeterH, G-Man yesterday
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
1
When you say, does not work as expected, what does and what does not work? Please add more details.
– LPChip
Nov 15 at 15:40
Just like in the answer provided below i expected the index.bat file to be run at start up or at login and see a command line windows running. But instead nothing happens. As if the task does not exist when i see that it does. there no errors. maybe it's a misconfiguration.
– jehovahsays
Nov 15 at 16:32
1
Are you sure it's not being run? Can youECHO
to a log file just to see if anything is written to it? If you selected "Run whether user is logged in or not", it may be running in the background with no visible command prompt window. If there is an error in thenode
command, it would also just flash a window for a moment and that might be too fast to see.
– Worthwelle
Nov 15 at 17:15
I know the process has not run because the node js express server isn't running. Now if I double click on it the command line window opens and the node js express server starts up on port 80
– jehovahsays
Nov 15 at 17:58
Why not just open a file explorer, go toshell:startup
and make a shortcut to your index.bat file there? That will also work, but does require the user to be logged in, something that may be a requirement for this anyway.
– LPChip
Nov 16 at 7:58
add a comment |
up vote
2
down vote
favorite
up vote
2
down vote
favorite
I have a batch file called index.bat
, which runs the following command:
node index.js
I tried to configure the file to be run on start up using schedule task manager and but it did not work as expected. What do I do?
command-line batch-file windows-task-scheduler
I have a batch file called index.bat
, which runs the following command:
node index.js
I tried to configure the file to be run on start up using schedule task manager and but it did not work as expected. What do I do?
command-line batch-file windows-task-scheduler
command-line batch-file windows-task-scheduler
edited Nov 15 at 15:12
rahuldottech
3,30932447
3,30932447
asked Nov 15 at 14:38
jehovahsays
1125
1125
put on hold as unclear what you're asking by LPChip, fixer1234, Toto, PeterH, G-Man yesterday
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
put on hold as unclear what you're asking by LPChip, fixer1234, Toto, PeterH, G-Man yesterday
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
1
When you say, does not work as expected, what does and what does not work? Please add more details.
– LPChip
Nov 15 at 15:40
Just like in the answer provided below i expected the index.bat file to be run at start up or at login and see a command line windows running. But instead nothing happens. As if the task does not exist when i see that it does. there no errors. maybe it's a misconfiguration.
– jehovahsays
Nov 15 at 16:32
1
Are you sure it's not being run? Can youECHO
to a log file just to see if anything is written to it? If you selected "Run whether user is logged in or not", it may be running in the background with no visible command prompt window. If there is an error in thenode
command, it would also just flash a window for a moment and that might be too fast to see.
– Worthwelle
Nov 15 at 17:15
I know the process has not run because the node js express server isn't running. Now if I double click on it the command line window opens and the node js express server starts up on port 80
– jehovahsays
Nov 15 at 17:58
Why not just open a file explorer, go toshell:startup
and make a shortcut to your index.bat file there? That will also work, but does require the user to be logged in, something that may be a requirement for this anyway.
– LPChip
Nov 16 at 7:58
add a comment |
1
When you say, does not work as expected, what does and what does not work? Please add more details.
– LPChip
Nov 15 at 15:40
Just like in the answer provided below i expected the index.bat file to be run at start up or at login and see a command line windows running. But instead nothing happens. As if the task does not exist when i see that it does. there no errors. maybe it's a misconfiguration.
– jehovahsays
Nov 15 at 16:32
1
Are you sure it's not being run? Can youECHO
to a log file just to see if anything is written to it? If you selected "Run whether user is logged in or not", it may be running in the background with no visible command prompt window. If there is an error in thenode
command, it would also just flash a window for a moment and that might be too fast to see.
– Worthwelle
Nov 15 at 17:15
I know the process has not run because the node js express server isn't running. Now if I double click on it the command line window opens and the node js express server starts up on port 80
– jehovahsays
Nov 15 at 17:58
Why not just open a file explorer, go toshell:startup
and make a shortcut to your index.bat file there? That will also work, but does require the user to be logged in, something that may be a requirement for this anyway.
– LPChip
Nov 16 at 7:58
1
1
When you say, does not work as expected, what does and what does not work? Please add more details.
– LPChip
Nov 15 at 15:40
When you say, does not work as expected, what does and what does not work? Please add more details.
– LPChip
Nov 15 at 15:40
Just like in the answer provided below i expected the index.bat file to be run at start up or at login and see a command line windows running. But instead nothing happens. As if the task does not exist when i see that it does. there no errors. maybe it's a misconfiguration.
– jehovahsays
Nov 15 at 16:32
Just like in the answer provided below i expected the index.bat file to be run at start up or at login and see a command line windows running. But instead nothing happens. As if the task does not exist when i see that it does. there no errors. maybe it's a misconfiguration.
– jehovahsays
Nov 15 at 16:32
1
1
Are you sure it's not being run? Can you
ECHO
to a log file just to see if anything is written to it? If you selected "Run whether user is logged in or not", it may be running in the background with no visible command prompt window. If there is an error in the node
command, it would also just flash a window for a moment and that might be too fast to see.– Worthwelle
Nov 15 at 17:15
Are you sure it's not being run? Can you
ECHO
to a log file just to see if anything is written to it? If you selected "Run whether user is logged in or not", it may be running in the background with no visible command prompt window. If there is an error in the node
command, it would also just flash a window for a moment and that might be too fast to see.– Worthwelle
Nov 15 at 17:15
I know the process has not run because the node js express server isn't running. Now if I double click on it the command line window opens and the node js express server starts up on port 80
– jehovahsays
Nov 15 at 17:58
I know the process has not run because the node js express server isn't running. Now if I double click on it the command line window opens and the node js express server starts up on port 80
– jehovahsays
Nov 15 at 17:58
Why not just open a file explorer, go to
shell:startup
and make a shortcut to your index.bat file there? That will also work, but does require the user to be logged in, something that may be a requirement for this anyway.– LPChip
Nov 16 at 7:58
Why not just open a file explorer, go to
shell:startup
and make a shortcut to your index.bat file there? That will also work, but does require the user to be logged in, something that may be a requirement for this anyway.– LPChip
Nov 16 at 7:58
add a comment |
1 Answer
1
active
oldest
votes
up vote
1
down vote
Do the following:
Open Task Scheduler from the start menu
From the menu,
Action
>Create task...
Under the
General
tab, give it a name, an optional description, and choose the security options.Under the
Triggers
tab, add a new one, and selectAt startup
from theBegin the task
drop-down menu.Under the
Actions
tab, add a new one, chooseStart a program
as the action, browse to your batch file, and select it. Specify optional arguments, and in theStart in:
dialogue, type the directory in which the batch file is located.Configure the conditions under which the file should run in the
Conditions
tab, and do the same in theSettings
tab.That's it, you're done! Have fun!
Alternatively, you can also just setnode.exe
to run on startup in the same manner, and set<path-to-file>index.js
as your argument.
– rahuldottech
Nov 15 at 15:08
I tried all of that and nothing happens. i think it might have to do with windows environment variables path to bash or cmd. maybe i didn't set the path correctly?
– jehovahsays
Nov 15 at 16:37
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
Do the following:
Open Task Scheduler from the start menu
From the menu,
Action
>Create task...
Under the
General
tab, give it a name, an optional description, and choose the security options.Under the
Triggers
tab, add a new one, and selectAt startup
from theBegin the task
drop-down menu.Under the
Actions
tab, add a new one, chooseStart a program
as the action, browse to your batch file, and select it. Specify optional arguments, and in theStart in:
dialogue, type the directory in which the batch file is located.Configure the conditions under which the file should run in the
Conditions
tab, and do the same in theSettings
tab.That's it, you're done! Have fun!
Alternatively, you can also just setnode.exe
to run on startup in the same manner, and set<path-to-file>index.js
as your argument.
– rahuldottech
Nov 15 at 15:08
I tried all of that and nothing happens. i think it might have to do with windows environment variables path to bash or cmd. maybe i didn't set the path correctly?
– jehovahsays
Nov 15 at 16:37
add a comment |
up vote
1
down vote
Do the following:
Open Task Scheduler from the start menu
From the menu,
Action
>Create task...
Under the
General
tab, give it a name, an optional description, and choose the security options.Under the
Triggers
tab, add a new one, and selectAt startup
from theBegin the task
drop-down menu.Under the
Actions
tab, add a new one, chooseStart a program
as the action, browse to your batch file, and select it. Specify optional arguments, and in theStart in:
dialogue, type the directory in which the batch file is located.Configure the conditions under which the file should run in the
Conditions
tab, and do the same in theSettings
tab.That's it, you're done! Have fun!
Alternatively, you can also just setnode.exe
to run on startup in the same manner, and set<path-to-file>index.js
as your argument.
– rahuldottech
Nov 15 at 15:08
I tried all of that and nothing happens. i think it might have to do with windows environment variables path to bash or cmd. maybe i didn't set the path correctly?
– jehovahsays
Nov 15 at 16:37
add a comment |
up vote
1
down vote
up vote
1
down vote
Do the following:
Open Task Scheduler from the start menu
From the menu,
Action
>Create task...
Under the
General
tab, give it a name, an optional description, and choose the security options.Under the
Triggers
tab, add a new one, and selectAt startup
from theBegin the task
drop-down menu.Under the
Actions
tab, add a new one, chooseStart a program
as the action, browse to your batch file, and select it. Specify optional arguments, and in theStart in:
dialogue, type the directory in which the batch file is located.Configure the conditions under which the file should run in the
Conditions
tab, and do the same in theSettings
tab.That's it, you're done! Have fun!
Do the following:
Open Task Scheduler from the start menu
From the menu,
Action
>Create task...
Under the
General
tab, give it a name, an optional description, and choose the security options.Under the
Triggers
tab, add a new one, and selectAt startup
from theBegin the task
drop-down menu.Under the
Actions
tab, add a new one, chooseStart a program
as the action, browse to your batch file, and select it. Specify optional arguments, and in theStart in:
dialogue, type the directory in which the batch file is located.Configure the conditions under which the file should run in the
Conditions
tab, and do the same in theSettings
tab.That's it, you're done! Have fun!
answered Nov 15 at 15:03
rahuldottech
3,30932447
3,30932447
Alternatively, you can also just setnode.exe
to run on startup in the same manner, and set<path-to-file>index.js
as your argument.
– rahuldottech
Nov 15 at 15:08
I tried all of that and nothing happens. i think it might have to do with windows environment variables path to bash or cmd. maybe i didn't set the path correctly?
– jehovahsays
Nov 15 at 16:37
add a comment |
Alternatively, you can also just setnode.exe
to run on startup in the same manner, and set<path-to-file>index.js
as your argument.
– rahuldottech
Nov 15 at 15:08
I tried all of that and nothing happens. i think it might have to do with windows environment variables path to bash or cmd. maybe i didn't set the path correctly?
– jehovahsays
Nov 15 at 16:37
Alternatively, you can also just set
node.exe
to run on startup in the same manner, and set <path-to-file>index.js
as your argument.– rahuldottech
Nov 15 at 15:08
Alternatively, you can also just set
node.exe
to run on startup in the same manner, and set <path-to-file>index.js
as your argument.– rahuldottech
Nov 15 at 15:08
I tried all of that and nothing happens. i think it might have to do with windows environment variables path to bash or cmd. maybe i didn't set the path correctly?
– jehovahsays
Nov 15 at 16:37
I tried all of that and nothing happens. i think it might have to do with windows environment variables path to bash or cmd. maybe i didn't set the path correctly?
– jehovahsays
Nov 15 at 16:37
add a comment |
1
When you say, does not work as expected, what does and what does not work? Please add more details.
– LPChip
Nov 15 at 15:40
Just like in the answer provided below i expected the index.bat file to be run at start up or at login and see a command line windows running. But instead nothing happens. As if the task does not exist when i see that it does. there no errors. maybe it's a misconfiguration.
– jehovahsays
Nov 15 at 16:32
1
Are you sure it's not being run? Can you
ECHO
to a log file just to see if anything is written to it? If you selected "Run whether user is logged in or not", it may be running in the background with no visible command prompt window. If there is an error in thenode
command, it would also just flash a window for a moment and that might be too fast to see.– Worthwelle
Nov 15 at 17:15
I know the process has not run because the node js express server isn't running. Now if I double click on it the command line window opens and the node js express server starts up on port 80
– jehovahsays
Nov 15 at 17:58
Why not just open a file explorer, go to
shell:startup
and make a shortcut to your index.bat file there? That will also work, but does require the user to be logged in, something that may be a requirement for this anyway.– LPChip
Nov 16 at 7:58