Timed bach file

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
sam
Posts: 1
Joined: 05 May 2012 05:53

Timed bach file

#1 Post by sam » 05 May 2012 05:58

Hello


My name is Sam, I'm from Belgium and i need some help/advice.
I should like to know if it possible to create a bat file that starts a exe file and closes it after x minutes?

It's because i'm making a thesis on brand placement in videogames and i want people to play the game for 5 minutes and then the game shout close down.

Anyone an idea?


thx

Matt20687
Posts: 54
Joined: 02 May 2012 14:42

Re: Timed bach file

#2 Post by Matt20687 » 05 May 2012 06:14

Hello,

Why not try

@echo off

start filename.exe
ping localhost -n 300 > nul
taskkill /F /IM filename.exe

pause>nul

Post Reply