Solved Some errors about running the command automatically before shut down

ytyyutianyun

New member
Local time
7:02 AM
Messages
17
A program often block the computer to shut down, so I want to run the command before shut down.

I run the bat :
Code:
 taskkill /f /im ZuoYou.exe

And I do the follow

Ashampoo_Snap_20131130_08h18m59s_001_.jpg

Ashampoo_Snap_20131130_08h19m53s_002_.jpg

Ashampoo_Snap_20131130_08h19m58s_003_.jpg

Ashampoo_Snap_20131130_08h20m03s_004_.jpg

Ashampoo_Snap_20131130_08h20m08s_005_.jpg


But nothing happens, why?
Ashampoo_Snap_20131129_22h22m27s_001_.jpg
 

My Computer

Computer type
PC/Desktop
OS
Windows 7 Ultimate x64
The name shown in the error message is not ZuoYou.exe.

The taskkill command /IM xxxxxxxxx has to be an exact match.

What does tasklist in a Command Prompt window show the name to be?
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Lenovo IdeaCenter 450
OS
Windows 10 Pro X64
CPU
Intel Quad Core i7-4770 @ 3.4Ghz
Memory
16.0GB PC3-12800 DDR3 SDRAM 1600 MHz
Graphics Card(s)
Intel Integrated HD Graphics
Sound Card
Realtek HD Audio
Monitor(s) Displays
HP 22" LCD
Screen Resolution
1680 x 1050
Hard Drives
250GB Samsung EVO SATA-3 SSD
2TB Seagate ST2000DM001 SATA-2
1.5TB Seagate ST3150041AS SATA
Keyboard
Dell USB
Mouse
Lenovo USB
Internet Speed
Cable via Road Runner 3MB Upload, 30MB Download
Antivirus
Windows Defender, MBAM Pro, MBAE
Browser
Seamonkey
Other Info
UEFI/GPT
PLDS DVD-RW DH16AERSH
The name shown in the error message is not ZuoYou.exe.

The taskkill command /IM xxxxxxxxx has to be an exact match.

What does tasklist in a Command Prompt window show the name to be?

Thanks for reply, and I think it is not the reason because if I run the command alone, it does kill the program.

And the picture as follows.
Ashampoo_Snap_20131130_09h53m36s_008_Processes.jpg
 

My Computer

Computer type
PC/Desktop
OS
Windows 7 Ultimate x64
I make the shut down command visible, and find it runs not before
Ashampoo_Snap_20131129_22h22m27s_001_.jpg


But after, that means I cannot automatically close the program when the window appears. So can anyone helps me to automatically close the program? Thanks
 

My Computer

Computer type
PC/Desktop
OS
Windows 7 Ultimate x64
Perhaps the batch file needs to be run as Administrator? Not sure how you accomplish that in a shutdown sctipt though.
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Lenovo IdeaCenter 450
OS
Windows 10 Pro X64
CPU
Intel Quad Core i7-4770 @ 3.4Ghz
Memory
16.0GB PC3-12800 DDR3 SDRAM 1600 MHz
Graphics Card(s)
Intel Integrated HD Graphics
Sound Card
Realtek HD Audio
Monitor(s) Displays
HP 22" LCD
Screen Resolution
1680 x 1050
Hard Drives
250GB Samsung EVO SATA-3 SSD
2TB Seagate ST2000DM001 SATA-2
1.5TB Seagate ST3150041AS SATA
Keyboard
Dell USB
Mouse
Lenovo USB
Internet Speed
Cable via Road Runner 3MB Upload, 30MB Download
Antivirus
Windows Defender, MBAM Pro, MBAE
Browser
Seamonkey
Other Info
UEFI/GPT
PLDS DVD-RW DH16AERSH
Perhaps the batch file needs to be run as Administrator? Not sure how you accomplish that in a shutdown sctipt though.

No, Now I know the mechanism, windows 7 runs the script only after it closes all the program. But Against the original intention. Because windows 7 cannot close the "Zuoyou", so it cannot run the script. And then I use the PS

Code:
stop-process -name ZuoYou
Start-Sleep -s 1
stop-computer -computername localhost


and these measures are temporary. Now I am learning the Autohotkey, and it may help me run the command immediately when I press the 'shutdown' button.
 

My Computer

Computer type
PC/Desktop
OS
Windows 7 Ultimate x64
Back
Top