Windows 7 Forums

Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: psshutdown works in console, but not as batch script

26 Feb 2016   #1
Banqu0

Windows 7 Ultimate 64bit
 
 
psshutdown works in console, but not as batch script

I'm attempting to remote shutdown a computer via PSTools, but so far I am only able to get the command to work via command console. A batch file is preferable, because it can be hotkeyed to a keyboard shortcut.

The syntax here has been unclear and I have used information in other threads to point me in the right direction. Most times, the script does nothing, but :

Code:
@echo off
start C:\PROGRAM_BIN\PSTools\psshutdown.exe /psshutdown \\REMOTECOMPUTERNAME -k -f -t 00
exit
actually shutdown the computer I'm trying to launch the command from

Any help is appreciated.


My System SpecsSystem Spec
.
28 Feb 2016   #2
Banqu0

Windows 7 Ultimate 64bit
 
 

I figured it out.

Code:
@echo off
start C:\PROGRAM_BIN\PSTools\psshutdown.exe  \\REMOTECOMPUTERNAME -k -f -t oo
exit
is the proper syntax
My System SpecsSystem Spec
Reply

 psshutdown works in console, but not as batch script




Thread Tools Search this Thread
Search this Thread:

Advanced Search




Similar help and support threads
Thread Forum
Help Need in batch script
Hi, I have my vendor's ftp url over SSL. it's like ftps://myvendor.com and i have username and password. So please help me on writing batch script t o downlod the file from my vendor repository. If this is not possible in dos script, please suggest me opensource tool. But i would love the...
General Discussion
Help Needed in Batch Script
Hi, I have 1000 image url in my text file(sample.txt) and i want to download the images using the url. Can anyone please share with me the sample script which can do this in single shot. Also, is there any way to reduce the size of the image into 20/20 px with png extension. Thanks
General Discussion
How to run cmd.exe elevated in batch script
Hi All, I am writing a dos batch file for windows7 and it has many commands which need elevated access to run. For elevation I am using elevate.exe. I am doing like below - set Elevation=elevate -wait cmd.exe /c %Elevation% "cd /d %CD% && xcopy /E /Y ...." %Elevation% "cd /d %CD% &&...
General Discussion
batch script help
dear all any help to make batch script this the reason i want to make a batch file is to help me update the online games in 60 computers by overwriting or copying big files in one click from 1 source computer... instead of turning on all 60 computers and updating all online games, he'll just...
General Discussion
Problem with echo in batch script
Morning i have a problem with batch script in Windows 7. this is my code: @echo off set mypath=c:\tools if not exist "%mypath%\architet.txt" goto check3264 find /I "x64-based PC" "%mypath%\architet.txt" >nul 2>&1 if %errorlevel% EQU 0 (set architet=64) ELSE (set architet=32) goto uacok...
General Discussion
Help me with Batch script!
Hi, Can somebody assist me with a .bat file I am trying to create? This is what I have now: start /d "C:\Users\Me\Desktop\ghost" ghost.exe start /d "C:\Users\Me\Desktop" Poweroff.exe C:\Windows\System32\powercfg.exe /setactive e428f8a5-615e-488f-b7f7-1ed39450e522The first 2 lines start...
Software


Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 19:40.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App