Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

How do I make a batch file play automatically just BEFORE PC goes into Standby?


  • Please log in to reply
6 replies to this topic

#1 glnz

glnz

  • Members
  • 15 posts
  • OFFLINE
  •  
  • Local time:12:23 PM

Posted 29 November 2009 - 03:01 PM

How do I make a batch file re-play itself automatically every 30 minutes? OR, better, how do I make a batch file play automatically just BEFORE the PC (WinXPPro SP3) goes into Standby?

Why do I ask? I'm having trouble with Wake on Ring. I want my Conexant modem card ALWAYS to answer my fax line and receive faxes, but it is NOT reliable about waking up when the PC is in standby. Sometimes it does, and sometimes it doesn't and I miss faxes.

So I wrote a very short batch file that has two powercfg command lines that seem to work in reminding the PC and the Conexant modem card that they should Wake on Ring during Standby. How do I get this batch file to play automatically either just before standby or (second-best) every 30 minutes or so when the PC is awake?

Thanks.

BC AdBot (Login to Remove)

 


#2 PropagandaPanda

PropagandaPanda


  • Malware Response Team
  • 10,433 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:12:23 PM

Posted 29 November 2009 - 09:03 PM

Hello.

Take a look at this page:
http://www.derkeiler.com/Newsgroups/micros...04-09/1788.html

You can access the Win32_PowerManagementEvent from a VBScript to see if the computer is entering standby.
Set colMonitoredEvents = GetObject("winmgmts:").ExecNotificationQuery("Select * from Win32_PowerManagementEvent")
while True
	  Set strLatestEvent = colMonitoredEvents.NextEvent 
	  If strLatestEvent.EventType = 4 then RunTheBatchFile
wend
Alternatively, you could just usethe VBScript to run the batch commands directly.

Tell me if you need help with that.

With Regards,
The Panda

Edited by PropagandaPanda, 29 November 2009 - 09:04 PM.


#3 glnz

glnz
  • Topic Starter

  • Members
  • 15 posts
  • OFFLINE
  •  
  • Local time:12:23 PM

Posted 29 November 2009 - 09:21 PM

Panda: Very sophisticated and above my level! But maybe it's time for me to start learning some VBScript. Tied up next few days, but I'll try this when I have a chance. However, to start at the very beginning - where would I paste this code text? Into a new .bat file? Or into a .txt file and then rename it with .exe?

Given your high level of knowledge, maybe you might have insight into the underlying problem: My Wake on Ring just doesn't work reliably. When my WinXPPro SP3 machine is in sleep/standby/suspend (S1 or S3 - makes no difference), and a fax comes in, sometimes the modem wakes the machine and the fax is received using fxssvc.exe, and sometimes the machine stays asleep. (When the machine is awake, it receives faxes beautifully.) I've set all the BIOS and modem card Power Management settings to permit Wake on Ring. Is there anything I could do to fix this intermittent relationship among fxssvc, the modem, wake on ring and the PC? (The PC is a very zippy Dell Optiplex 755 with latest BIOS and 2GB RAM, and the modem is a Conexant D850, which I have initially-, un- and re-installed thrice.) I've tried everything else I can find. Is there a portion of WinXP to re-install, and how would I do that?

By the way, I now think my idea to remind the PC with the two powercfg settings just before standby is NOT going to fix the problem, although I shall continue to tinker. After one fax came in tonight and woke the machine from standby, the machine stopped responding to subsequent faxes.

Thanks. Looking forward to more high-level suggestions from you.

#4 PropagandaPanda

PropagandaPanda


  • Malware Response Team
  • 10,433 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:12:23 PM

Posted 29 November 2009 - 09:33 PM

Hello glnz.

No need to say that I'm "high leveled". I'm really not that much.

I have no experience with Wake on Ring, so I can't help you with that directly. However, if you can find a method and need to automate that, such as the originally suggested one, I could help with scripting that.

With Regards,
The Panda

#5 glnz

glnz
  • Topic Starter

  • Members
  • 15 posts
  • OFFLINE
  •  
  • Local time:12:23 PM

Posted 29 November 2009 - 10:57 PM

Thanks. In what type of file should I paste this code?

Edited by glnz, 29 November 2009 - 10:58 PM.


#6 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:10:23 AM

Posted 30 November 2009 - 12:52 PM

You may find this helpful: What is VBScript

#7 askpcguy

askpcguy

  • Members
  • 22 posts
  • OFFLINE
  •  
  • Local time:09:23 AM

Posted 06 December 2009 - 12:12 AM

If you check the modem in Device Manager, you can look on the power tab and set the device to wake up the computer if the computer is in Standby mode.

Check this forum for more information http://social.answers.microsoft.com/Forums...e1-591b5be726cc

Always create backups of your registry before making any changes. Click Start > Run and type in REGEDIT then press enter. Click File in the Registry Editor > Export > Make sure at the bottom you have selected Export Range to ALL and save the file in an easily accessible location.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users