1

I have a VBS file that is runing a bat file in background(the bat file is registering the voice for 1 hour. I want to make this VBS file to run every hour so i can register the voice non stop.

My bat file is like this:

@echo off
mkdir "My records"
set outputpath=My records\record_%date:~-2,2%%date:~-7,2%%date:~-10,2%_%time:~-11,2%%time:~-8,2%.mp3
ffmpeg -f dshow -i audio="Microphone (Realtek High Definition Audio)" -y -t 01:00:00 "%outputpath%"

And my VBS file is like this:

Set WshShell = CreateObject("WScript.Shell") 
WshShell.Run chr(34) & "C:\Users\immol\Desktop\voice recorder\record.bat" & Chr(34), 0
Set WshShell = Nothing

So, can someone advise how to make this VBS run every hour and have recording the voice for 24/7 ? Thank you

Stephan
  • 53,940
  • 10
  • 58
  • 91
Vi Cez
  • 11
  • 1
  • 3
    Have you considered using the task scheduler? Why using a `VBS` when all, it does is to execute the batch file? – Stephan Oct 02 '19 at 19:16
  • @Stephan I think he wants to hide the console when calling the vbs with argument 0 – Hackoo Oct 03 '19 at 03:27
  • Hello, yes i want to make it run in background and i tried task scheduler, but i think i`m doing something wrong. – Vi Cez Oct 03 '19 at 12:47
  • @ViCez Take a look at this question => [Create a task that runs every day and repeats every hour](https://stackoverflow.com/questions/21437787/schtasks-create-have-a-task-that-runs-every-day-and-repeats-every-hour) – Hackoo Oct 04 '19 at 04:50

1 Answers1

0

If you are running in linux enviroment, this sounds like a cron job. Here is the wiki for cron: wiki. Here is a tutorial

erncyp
  • 1,649
  • 21
  • 23