RC-Monster Forums  

Go Back   RC-Monster Forums > RC-Monster Area > General Discussion

Reply
 
Thread Tools Rate Thread Display Modes
WindowsXP Question
Old
  (#1)
What's_nitro?
Soldermaster Extraordinaire
 
What's_nitro?'s Avatar
 
Offline
Posts: 4,529
Join Date: Apr 2007
Location: Plymouth, MA, USA
WindowsXP Question - 04.29.2011, 09:05 AM

So I've been using Taskkill to close Windows Media Player through Task Scheduler via a .batch file. I put music on when I go to bed and set it to close an hour later. Now, for some reason, the batch file won't do it's job when opened through the Task Scheduler. If I open the batch file directly (right-click, open) it works fine. If I go into Task Scheduler and manually run the task, I can see the CMD window flash- so I believe it is opening the batch file, but it doesn't close WMP. Nothing has changed (to my knowledge) since two nights ago (the last time it worked) so I don't have a clue what's going on.

Wierd, huh?
   
Reply With Quote
Old
  (#2)
BrianG
RC-Monster Admin
 
BrianG's Avatar
 
Offline
Posts: 14,609
Join Date: Nov 2005
Location: Des Moines, IA
04.29.2011, 09:54 AM

Unsure why taskkill isn't doing the job. I use taskkill in a batch file at work on a Windows Server 2008 box and it works fine as a scheduled task. I don't have an XP box ATM to look, but is there an option for the scheduled task properties to run with elevated permissions or something like that?

Alternatively, why not set up a batch file that you run manually before you go to bed. That way, it will run for an hour (or whatever time frame you want) after you run it, not on a specific time.

This is the batch I run at work to open IE, run something, and then kill it after 60 sec (I blanked out the actual URL):

start iexplore address url
ping -n 1 -w 60000 1.1>nul
taskkill /pid iexplore.exe

The ping part, which really does nothing except adds a delay, is what causes the batch to wait 60 sec (60,000 milli-seconds) before it kills the process. For an hour, the wait value would be 3,600,000
  Send a message via Yahoo to BrianG Send a message via MSN to BrianG  
Reply With Quote
Old
  (#3)
josh9mille
RC-Monster Aluminum
 
josh9mille's Avatar
 
Offline
Posts: 897
Join Date: Mar 2010
Location: Same town as "Brand P"
04.29.2011, 10:18 AM

couldnt you just set your computer to go to sleep/idle/shut off an hour after you last touch it?


Built Ford tough, with Chevy stuff.
   
Reply With Quote
Old
  (#4)
What's_nitro?
Soldermaster Extraordinaire
 
What's_nitro?'s Avatar
 
Offline
Posts: 4,529
Join Date: Apr 2007
Location: Plymouth, MA, USA
04.29.2011, 01:09 PM

Brian- I'm an admin on my PC, so it's not a permissions problem. I think I'll try putting a timer on the taskkill command.

Josh- I could do that, but I usually keep it on so that I can access it quickly. I don't feel like waiting 39 seconds for it to boot up.

Thanks guys!
   
Reply With Quote
Old
  (#5)
BrianG
RC-Monster Admin
 
BrianG's Avatar
 
Offline
Posts: 14,609
Join Date: Nov 2005
Location: Des Moines, IA
04.29.2011, 01:24 PM

You could have it set to standby or hibernate, not reboot:

Standby %windir%\System32\rundll32.exe powrprof.dll,SetSuspendState Standby

Hibernate %windir%\System32\rundll32.exe powrprof.dll,SetSuspendState Hibernate
  Send a message via Yahoo to BrianG Send a message via MSN to BrianG  
Reply With Quote
Old
  (#6)
What's_nitro?
Soldermaster Extraordinaire
 
What's_nitro?'s Avatar
 
Offline
Posts: 4,529
Join Date: Apr 2007
Location: Plymouth, MA, USA
04.29.2011, 01:41 PM

I know, but I just prefer to keep it on.

The "direct from batch file" approach works fine. I'm using this code:

start wmplayer.exe "D:\Music\!Playlists\Playlist1.wpl"
ping -n 1 -w 3600000 1.1>nul
taskkill /f /im wmplayer.exe

The Task Scheduler approach required me to manually change the runtime for the batch file every night, since I rarely get to bed at the same time two nights in a row. This way is much simpler.

Last edited by What's_nitro?; 04.29.2011 at 01:44 PM.
   
Reply With Quote
Old
  (#7)
BrianG
RC-Monster Admin
 
BrianG's Avatar
 
Offline
Posts: 14,609
Join Date: Nov 2005
Location: Des Moines, IA
04.29.2011, 02:35 PM

I would first set a smaller interval, something like 30 seconds, to make sure it works like you want.
  Send a message via Yahoo to BrianG Send a message via MSN to BrianG  
Reply With Quote
Old
  (#8)
What's_nitro?
Soldermaster Extraordinaire
 
What's_nitro?'s Avatar
 
Offline
Posts: 4,529
Join Date: Apr 2007
Location: Plymouth, MA, USA
04.29.2011, 04:26 PM

I did. I tested it with "3600" as the delay. Thanks!
   
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump







Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
vBulletin Skin developed by: vBStyles.com