Shutdown PC w/ batch file (1hour) after program(game) launched

lambda

New member
Local time
2:49 AM
Messages
6
Is it possible to do this? I want to make it so that a game shuts down the computer after "X" seconds/minutes/hours of playing the game. But i want the file to be somewhat undetected. I don't want it popping up with a message saying things like "PC will shutdown in 3 minutes" or anything like that i just want it to have an auto shutdown or restart as if it had a virus or something was wrong with the PC.

I know batch files can do something like this so if you guys knew a little something to help me out thanks very much for your input ;)

Just a little prank I'm pulling and your help would be great.
 

My Computer My Computer

At a glance

Windows 7 x64
OS
Windows 7 x64
(i'm too lazy to create the .bat today)

Use the Remote Shutdown Tool to Shutdown, Restart, or Logoff a Local or Networked Computer — MAXIMUMpcguides – Windows Vista tips, tricks, help, and how-to guides

Create the .bat file with options you want, info in the link.

Then once you're done... Modify the Game's shortcut icon to point to the .bat file... keep the original .ico in place so it looks like they're launching the game... As long as you have rights to the machine, this will do what you want.
 

My Computer My Computer

At a glance

7 Pro
OS
7 Pro
I think you'd have a lot more luck dealing with the task scheduler for something like this.
Schedule a task
 

My Computer My Computer

At a glance

Windows 7 x64Intel i7 2600kG.skill Ripjaw 16gigs @ 1866Nvidia gtx580 (evga)
Computer Manufacturer/Model Number
Insane hobo technologies. ;-)
OS
Windows 7 x64
CPU
Intel i7 2600k
Motherboard
Asrock z68 extreme 4 gen 3
Memory
G.skill Ripjaw 16gigs @ 1866
Graphics Card(s)
Nvidia gtx580 (evga)
Sound Card
Integrated HD audio + hdmi
Monitor(s) Displays
24" ASUS widescreen + 42" insignia
Screen Resolution
1080p (1920x1080)
Hard Drives
128 Samsung 830
256 Samsung 840
3 x 1tb storage drive (various)
1 western digital 1tb (eSATA)
1 Seagate 1tb (eSATA)
PSU
1 kilowatt SLI/Crossfire rated Silverstone modular
Case
NZXT Phantom + additional 220 fan
Cooling
Zalmann
Keyboard
Microsoft wireless 3000 (v2)
Mouse
MS - wireless 5000 (bluetrack)
Internet Speed
depends on if you ask me or my provider.
Other Info
The above information is provided as is, and the author assumes no responsibility for issues it may cause with your sanity or fanboyism.
this is what i have right now.

@echo off

rem Notepad
cd C:\Program Files\game
start game.exe
exit

but how do i make it shut down? where do i add the -s -t 600?
 

My Computer My Computer

At a glance

Windows 7 x64
OS
Windows 7 x64
Shutdown -s -t 3600

3600 seconds should be one hour.
 

My Computer My Computer

At a glance

Windows 7 x64Intel i7 2600kG.skill Ripjaw 16gigs @ 1866Nvidia gtx580 (evga)
Computer Manufacturer/Model Number
Insane hobo technologies. ;-)
OS
Windows 7 x64
CPU
Intel i7 2600k
Motherboard
Asrock z68 extreme 4 gen 3
Memory
G.skill Ripjaw 16gigs @ 1866
Graphics Card(s)
Nvidia gtx580 (evga)
Sound Card
Integrated HD audio + hdmi
Monitor(s) Displays
24" ASUS widescreen + 42" insignia
Screen Resolution
1080p (1920x1080)
Hard Drives
128 Samsung 830
256 Samsung 840
3 x 1tb storage drive (various)
1 western digital 1tb (eSATA)
1 Seagate 1tb (eSATA)
PSU
1 kilowatt SLI/Crossfire rated Silverstone modular
Case
NZXT Phantom + additional 220 fan
Cooling
Zalmann
Keyboard
Microsoft wireless 3000 (v2)
Mouse
MS - wireless 5000 (bluetrack)
Internet Speed
depends on if you ask me or my provider.
Other Info
The above information is provided as is, and the author assumes no responsibility for issues it may cause with your sanity or fanboyism.
okay so i got it working but how do i get rid of the warning?
 

My Computer My Computer

At a glance

Windows 7 x64
OS
Windows 7 x64
I believe adding the /f or /p modifier will both remove the user notification.
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

shutdown /?
Usage: shutdown [/i | /l | /s | /r | /g | /a | /p | /h | /e] [/f]
[/m \\computer][/t xxx][/d [p|u:]xx:yy [/c "comment"]]

No args Display help. This is the same as typing /?.
/? Display help. This is the same as not typing any options.
/i Display the graphical user interface (GUI).
This must be the first option.
/l Log off. This cannot be used with /m or /d options.
/s Shutdown the computer.
/r Shutdown and restart the computer.
/g Shutdown and restart the computer. After the system is
rebooted, restart any registered applications.
/a Abort a system shutdown.
This can only be used during the time-out period.
/p Turn off the local computer with no time-out or warning.
Can be used with /d and /f options.
/h Hibernate the local computer.
Can be used with the /f option.
/e Document the reason for an unexpected shutdown of a computer.
/m \\computer Specify the target computer.
/t xxx Set the time-out period before shutdown to xxx seconds.
The valid range is 0-315360000 (10 years), with a default of 30.
If the timeout period is greater than 0, the /f parameter is
implied.
/c "comment" Comment on the reason for the restart or shutdown.
Maximum of 512 characters allowed.
/f Force running applications to close without forewarning users.
The /f parameter is implied when a value greater than 0 is
specified for the /t parameter.

/d [p|u:]xx:yy Provide the reason for the restart or shutdown.
p indicates that the restart or shutdown is planned.
u indicates that the reason is user defined.
If neither p nor u is specified the restart or shutdown is
unplanned.
xx is the major reason number (positive integer less than 256).
yy is the minor reason number (positive integer less than 65536).
 

My Computer My Computer

At a glance

Windows 7 x64Intel i7 2600kG.skill Ripjaw 16gigs @ 1866Nvidia gtx580 (evga)
Computer Manufacturer/Model Number
Insane hobo technologies. ;-)
OS
Windows 7 x64
CPU
Intel i7 2600k
Motherboard
Asrock z68 extreme 4 gen 3
Memory
G.skill Ripjaw 16gigs @ 1866
Graphics Card(s)
Nvidia gtx580 (evga)
Sound Card
Integrated HD audio + hdmi
Monitor(s) Displays
24" ASUS widescreen + 42" insignia
Screen Resolution
1080p (1920x1080)
Hard Drives
128 Samsung 830
256 Samsung 840
3 x 1tb storage drive (various)
1 western digital 1tb (eSATA)
1 Seagate 1tb (eSATA)
PSU
1 kilowatt SLI/Crossfire rated Silverstone modular
Case
NZXT Phantom + additional 220 fan
Cooling
Zalmann
Keyboard
Microsoft wireless 3000 (v2)
Mouse
MS - wireless 5000 (bluetrack)
Internet Speed
depends on if you ask me or my provider.
Other Info
The above information is provided as is, and the author assumes no responsibility for issues it may cause with your sanity or fanboyism.
@echo off


cd C:\Program Files\game
start game.exe
shutdown -s -p -f -t 10
exit


this is what im tryin to use but the computer doesnt shut down. how should i structure this for it to work?
 

My Computer My Computer

At a glance

Windows 7 x64
OS
Windows 7 x64
The switches are different format it this way
shutdown /p -s -t 10

including both p and f seems redundant just try one then the other until you get the behavior you want.
 

My Computer My Computer

At a glance

Windows 7 x64Intel i7 2600kG.skill Ripjaw 16gigs @ 1866Nvidia gtx580 (evga)
Computer Manufacturer/Model Number
Insane hobo technologies. ;-)
OS
Windows 7 x64
CPU
Intel i7 2600k
Motherboard
Asrock z68 extreme 4 gen 3
Memory
G.skill Ripjaw 16gigs @ 1866
Graphics Card(s)
Nvidia gtx580 (evga)
Sound Card
Integrated HD audio + hdmi
Monitor(s) Displays
24" ASUS widescreen + 42" insignia
Screen Resolution
1080p (1920x1080)
Hard Drives
128 Samsung 830
256 Samsung 840
3 x 1tb storage drive (various)
1 western digital 1tb (eSATA)
1 Seagate 1tb (eSATA)
PSU
1 kilowatt SLI/Crossfire rated Silverstone modular
Case
NZXT Phantom + additional 220 fan
Cooling
Zalmann
Keyboard
Microsoft wireless 3000 (v2)
Mouse
MS - wireless 5000 (bluetrack)
Internet Speed
depends on if you ask me or my provider.
Other Info
The above information is provided as is, and the author assumes no responsibility for issues it may cause with your sanity or fanboyism.
okay thanks also, how about shutting a network computer down?

shutdown /m \\cool_computer /s

should that work?
 

My Computer My Computer

At a glance

Windows 7 x64
OS
Windows 7 x64
Back
Top