Web Hosting, Design, & Coding forum

General discussion

Batch files to run a program only if the time is >8:00

by stratosrv / June 26, 2013 4:10 AM PDT

Hi friends, i need to write a batch files to run a .exe files only if the hour of the day is greather than 8:00.

So..i run a .bat files with task scheduler every 5 minute whit the command "start" and then if the hour of the day is greather than 8:00 the program start.if not the program don't start..

Example.. if i have a task scheduler setting to start Notepad.exe at 8:00 and i turn on my pc at 8:05 this task don't start...and i think to need a batch files running via task scheduler every minutes to check the time and then run the notepad .exe if the condiction is ok.

Sorry for my bad explication but english is not my language..
Thank you very mutch.
Luke.

Post a reply
Discussion is locked
You are posting a reply to: Batch files to run a program only if the time is >8:00
The posting of advertisements, profanity, or personal attacks is prohibited. Please refer to our CNET Forums policies for details. All submitted content is subject to our Terms of Use.
Track this discussion and email me when there are updates

If you're asking for technical help, please be sure to include all your system info, including operating system, model number, and any other specifics related to the problem. Also please exercise your best judgment when posting in the forums--revealing personal information such as your e-mail address, telephone number, and address is not recommended.

You are reporting the following post: Batch files to run a program only if the time is >8:00
This post has been flagged and will be reviewed by our staff. Thank you for helping us maintain CNET's great community.
Sorry, there was a problem flagging this post. Please try again now or at a later time.
If you believe this post is offensive or violates the CNET Forums' Usage policies, you can report it below (this will not automatically remove the post). Once reported, our moderators will be notified and the post will be reviewed.
Collapse -
Just checking.
by R. Proffitt Forum moderator / June 26, 2013 4:18 AM PDT
Collapse -
I checked...
by stratosrv / June 26, 2013 4:43 AM PDT
In reply to: Just checking.

Hi..
I checked " run as soon as possible..."

So now i try to miss a trigger time..turning on my pc at 8:10 and the "notepad.exe" in theory must start..
I post the result as soon...

Luke.

Collapse -
Sorry but I gotta ask.
by R. Proffitt Forum moderator / June 26, 2013 5:06 AM PDT
In reply to: I checked...

If the user is not logged on, why must it start? Where would it display?

Collapse -
I checked...
by stratosrv / June 27, 2013 1:16 AM PDT
In reply to: Sorry but I gotta ask.

Hi..
I checked " run as soon as possible..."
And "Run whether user is logged on or not",
But still not working for me.
Maybe i miss or don't fully understand the philosopy of this task scheduler.

Thank you.
Luke.

Collapse -
Not philosophy.
by R. Proffitt Forum moderator / June 27, 2013 1:25 AM PDT
In reply to: I checked...

I asked you a question to draw out what you knew about this area. For example what would you expect to happen if the user was not logged in?

I would expect the launch of notepad to fail. I can't hold a class on this OS here but when you go this deep you would have to get a grasp of the basics and more.

So far, as presented I see nothing wrong.
Bob

Collapse -
Not philosophy.
by stratosrv / June 27, 2013 1:52 AM PDT
In reply to: Not philosophy.

Hi dear friends...

Now i tell the true..
I have my home server "headless" i manage only with remote desktop...The OS is windows server 2008 R2.

I need to start a program at 8:00 if the server is ON....but if i turn ON the server at 8:10 i miss the task scheduler..and the software is OFF...

But i can't put this program to start automatically at "machine on" because if turn on the server at 6:00 i don't need this program running.

Normally the server when is on is without a user logged on, except when i manage whit remote desktop..
So i think on the task scheduler have to check the box "Run whether user is logged on or not".

And i think i need a script to check the hour of the day to decide if the software can start or not and run this script every minute or two...this is my idea..

CiAo

Collapse -
Writing your own app may be better.
by R. Proffitt Forum moderator / June 27, 2013 1:57 AM PDT
In reply to: Not philosophy.

But let's clear something up. You used NOTEPAD as your example and since that's an interactive app with a logged in user this is not something you would expect to find in Task Scheduler.

Once in a while you find a member not sharing exactly what they are doing and it fails to yield a good answer since they were not sharing exactly what they wanted to do. That is, it wasn't NOTEPAD at all.

There's more to this such as an app may have a dependency. Even NOTEPAD has dependencies and since that word (dependency) is covered in the class work I don't cover that chapter here.

I don't mind discussing this area but it feels as if there is more to this story.
Bob

Collapse -
Writing your own app may be better.
by stratosrv / June 27, 2013 2:13 AM PDT

Hi...

Really the app is emule..and i'm trying to manage it to work only in a certain hour without depend the hour of the day i turn on the server....

Luke.

Collapse -
It's a shame that was not revealed up front.
by R. Proffitt Forum moderator / June 27, 2013 2:18 AM PDT

Because NOTEPAD must interact with the user desktop there are fine reasons it may not launch.

Just some parting advice. Don't obfuscate a discussion. Otherwise you may not get the answer you wanted.
Bob

Collapse -
Ok..
by stratosrv / June 27, 2013 2:23 AM PDT

Hi Bob..
sorry for "obfuscate" a discussion..really my mistake, but i generalize about the software only because is a simple .exe and i think the answer may be good for other user..

Thank you.
Luke.

Collapse -
NOTEPAD is not a simple exe.
by R. Proffitt Forum moderator / June 27, 2013 2:26 AM PDT
In reply to: Ok..

As this discussion has run its course and we know that apps like NOTEPAD have dependencies and need an user to be logged on and well, a short list of requirements for it to launch, it's a bit late to start again on some other app.

Why would you think these are simple executable apps is a mystery but I'm sure you will catch up soon.

Sorry but I was mislead on what you wanted to do and can only wish you the best.
Bob

Popular Forums
icon
Computer Help 47,885 discussions
icon
Computer Newbies 10,322 discussions
icon
iPhones, iPods, & iPads 3,188 discussions
icon
Security 30,333 discussions
icon
TVs & Home Theaters 20,177 discussions
icon
HDTV Picture Setting 1,932 discussions
icon
Phones 15,713 discussions
icon
Windows 7 6,210 discussions
icon
Networking & Wireless 14,510 discussions

Big stars on small screens

Smosh tells CNET what it took to make it big online

Internet sensations Ian Hecox and Anthony Padilla discuss how YouTube has changed and why among all their goals, "real TV" isn't an ambition.