How to run a batch file on a schedule no matter who is logged in.

I need to run a simple batch file that calls to a text file to instructions for WinSCP.

I have set up Windows Scheduler, but have found if a user is not logged on the batch does not run.

So I need a free, simple way of running the batch on a schedule, no matter who is logged in or if no one is logged on.

Thx in advance,
matt
TX_SCUBAAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

DrunkenELFCommented:
If you want that specific bat to run automatically when windows boots, you have a few options, the startup folder is one good and really easy option. However, you can also create a registry (start-run-regedit) key in hklm-software-microsoft-windows-current version-run that points to your batch file. This method is really easier than it seems and will ensure that the batch fille will run automatically no matter who logs in.
0
DrunkenELFCommented:
Dear Scuba,
The easiest way in my opinion is to create a scheduled task (the wizard is in the control panel). Choose the batch file you created as the program to run and choose "When my computer starts" as the time to execute.
Cheers!
D-ELF

0
TX_SCUBAAuthor Commented:
Thanks D-ELF

But I need the bats to run at say 4:00 AM daily and another at 7:00 and another....  and....

~
0
IT Pros Agree: AI and Machine Learning Key

We’d all like to think our company’s data is well protected, but when you ask IT professionals they admit the data probably is not as safe as it could be.

Lee W, MVPTechnology and Business Process AdvisorCommented:
Scheduled task works - if it didn't I wouldn't get my backup notifications.  My backups are run through batch files scheduled through Scheduled Tasks.
0
TX_SCUBAAuthor Commented:
Kinda off topic- how do you get your backup logs?
What kind of task due you schedule?

On topic-
Does it work when someone else is logged on?  It runs when I am signed on but does not otherwise.

~
0
DrunkenELFCommented:
Hi,
A Timer would be th ideal thing.

create a loop.
C attached example:

U can use ping to create a timed delay
Cheers!
D-ELF

:START
REM Execute the MS-DOS dir command ever 20 seconds.
dir
SLEEP 20
GOTO ENDOR

Open in new window

0
StyphonCommented:
If you schedule a task you have the option to run it as a specific user, as if that user was logged on. Set it to run at a specific time and it will run regardless if a user is logged on or not using the credentials you supply it.
0
AmazingTechCommented:
In your scheduled tasks.

Change the run as user to SYSTEM. No Password.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ltlbearand3Commented:
I think you almost have what you need if it is already set up in the Windows Task Schedule.

Open the Task Schedule.
Find your scheduled task
Right click on that task and select Properties
On the Task tab, uncheck the box that states "Run only if logged on"
Now make sure the Run As box has a user set with the correct privileges and has their password assigned.

-Bear
0
TX_SCUBAAuthor Commented:
Bear got the goods on how to set a schedule, thanks.  What I need is what AmazingTech is suggesting, running as SYSTEM.  Our passwords change every 45 days so maintaining a host of these jobs is more than I want to carry.

Is there a way to run a Schedule a Job to Run as SYSTEM with Windows XP?

~
0
ltlbearand3Commented:
In the Run As box enter
NT AUTHORITY\SYSTEM

That should do the trick

-Bear
0
AmazingTechCommented:
In the scheduled tasks run as you only need to put in SYSTEM it will change it to NT AUTHORITY\SYSTEM.
0
TX_SCUBAAuthor Commented:
and what is the password I am to use?  I have tryed the local admin with no joy.

~
0
AmazingTechCommented:
Leave it blank. No password for SYSTEM or NT AUTHORITY\SYSTEM
0
TX_SCUBAAuthor Commented:
Thanks all who helped on this one.  Thanks Amazing for finally being able to get me to understand that the SYSTEM account does not require a password.
~
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Batch

From novice to tech pro — start learning today.