Question

My division has been tasked with recording the morning presentation audio for future use, using the built-in Windows Sound Recorder. Because of human nature, we don't always remember to start it on time.

Windows doesn't have a built-in equivalent to the Unix cron function. Besides installing a new software program (which will take time, possibly cost money, and require IA certification), is there an easy way to automate the recording?

I'm not adverse to writing a simple Python script for it, but I haven't programmed for Windows before; I don't know the APIs or anything required for this type of program.


Edit Thanks for the responses. I feel like an imbecile. I don't normally use Windows computers so I wasn't aware that Windows had the Task Scheduler.

However, when I tested it with the recorder program, all it did was open the program; it didn't actually start recording. How do I get it to actually start recording when it is opened?

Was it helpful?

Solution

set WshShell = WScript.CreateObject("WScript.Shell") 
WScript.Sleep(100)
WshShell.Run "%SystemRoot%\system32\sndrec32.exe" 
WScript.Sleep(100)
WshShell.AppActivate "Sound - Sound Recorder" 
WScript.Sleep(100)
WshShell.SendKeys " " 
WScript.Sleep(100)

Save the above text as RunSoundRecorder.vbs. This will start the sound record application and start it recording. Just point the task scheduler at this file.

Incase you want to make changes:
The third line is the exe to run
The fifth line is the what is in the application title bar.

OTHER TIPS

Use AutoIt3

Run ( @SystemDir + "\sndrec32.exe", "workingdir" )
Sleep(5000) ;five seconds
WinActivate( "Sound - Sound Recorder" )
Sleep(100)
Send( " " )

Note: I have not tested this, because I don't use Windows very often anymore.

Definitely worth checking out if you want to automate any Win32 Gui. It actually seems like it has received even more features since I last used it.

Features: ( taken from www.autoitscript.com/autoit3/ )

  • Easy to learn BASIC-like syntax
  • Simulate keystrokes and mouse movements
  • Manipulate windows and processes
  • Interact with all standard windows controls
  • Scripts can be compiled into standalone executables
  • Create Graphical User Interfaces (GUIs)
  • COM support
  • Regular expressions
  • Directly call external DLL and Windows API functions
  • Scriptable RunAs functions
  • Detailed helpfile and large community-based support forums
  • Compatible with Windows 95 / 98 / ME / NT4 / 2000 / XP / 2003 / Vista / 2008
  • Unicode and x64 support
  • Digitally signed for peace of mind
  • Works with Windows Vista's User Account Control (UAC)

There is no command line parameter to start in recording mode. You have to Start recording manually!

Start-Programs-Accessories-System Tools-Scheduled Tasks

You can simply Schedule in Windows.

Heres an article that shows in simple steps. How to use the Windows Task Scheduler

And there is even alt text
(source: visualcron.com)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top