Renderer Posted October 24, 2015 Posted October 24, 2015 Hello guys! I need some help! I got 2 PCs and i've placed them in separte rooms. It's tedious job to move every night from one room to another to close my PCs.I've tried the remote shutdown command but i've got the 'Access is denied.<5>' message.I need some sollutions to slove this error.Thanks in advance!
Developers Jos Posted October 24, 2015 Developers Posted October 24, 2015 (edited) PSTOOLS: PsShutdown and use an account with admin rights on the remote computer.Jos Edited October 24, 2015 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Moderators JLogan3o13 Posted October 24, 2015 Moderators Posted October 24, 2015 I agree with Exit, TeamViewer is an easy option. If you're going to go with just a remote shutdown, obviously you need to be running it with credentials that have rights to shut the server down. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
nitekram Posted October 24, 2015 Posted October 24, 2015 Could use VNC and remote in to shut it down, though I think there are faster ways, listed above. 2¢ All by me:"Sometimes you have to go back to where you started, to get to where you want to go." "Everybody catches up with everyone, eventually" "As you teach others, you are really teaching yourself." From my dad "Do not worry about yesterday, as the only thing that you can control is tomorrow." WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2 AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit Docs SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language Programming Tips Excel Changes ControlHover.UDF GDI_Plus Draw_On_Screen GDI Basics GDI_More_Basics GDI Rotate GDI Graph GDI CheckExistingItems GDI Trajectory Replace $ghGDIPDll with $__g_hGDIPDll DLL 101? Array via Object GDI Swimlane GDI Plus French 101 Site GDI Examples UEZ GDI Basic Clock GDI Detection Ternary operator
AdamUL Posted October 30, 2015 Posted October 30, 2015 Are you running the command in an elevated command prompt? Also, is the account you are running the command under in the remote PCs' Local Administrators group? If you are running it as a Scheduled Task, be sure to check the "Run with highest privileges" box. Adam
lewisg Posted November 2, 2015 Posted November 2, 2015 I use this in for a script at work.ShellExecute("shutdown.exe","/s /m \\" & $PickPC, "", "open", @SW_HIDE)"$PickPC" is a var grabbed from a ListView
BrewManNH Posted November 2, 2015 Posted November 2, 2015 If you remove the @SW_HIDE does the console window show you any errors? If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator
AdamUL Posted November 2, 2015 Posted November 2, 2015 You need to run your script with elevated permissions, using one of the following. #RequreAdmin#pragma compile(ExecLevel, requireAdministrator)If you installed SciTE4AutoIt3.#AutoIt3Wrapper_Res_requestedExecutionLevel=requireAdministratorYou could just try running that command as administrator.ShellExecute("shutdown.exe","/s /m \\" & $PickPC, "", "runas", @SW_HIDE) Adam
orbs Posted November 5, 2015 Posted November 5, 2015 (edited) the main issue is with permissions on the target pc, so "elevating" the command cannot work, as "elevation" usually means admin permissions on the host running the command (which is not needed, btw), not on the target host. that is, unless you "elevate" to a domain admin, which is usually not referred to as "elevation".if shutdown is all you need, then TeamViewer/VNC/RDP and the likes are overkill and will only delay the process. Jos (post #3) pretty much nailed it, although i don't see the need to use external tools when a native command is sufficient. this should do the trick (not tested):RunAs($sTargetAdminName, $sTargetHostName, $sTargetAdminPassword, 2, 'shutdown.exe /s /m ' & $sTargetHostName & ' /t:0 /f')Note: mind you don't miss a whitespace when incorporating a string variable into an hardcoded text string! EDIT: also, i fail to see why this topic should not be in the General Help and Support forum. Edited November 5, 2015 by orbs Signature - my forum contributions: Spoiler UDF: LFN - support for long file names (over 260 characters) InputImpose - impose valid characters in an input control TimeConvert - convert UTC to/from local time and/or reformat the string representation AMF - accept multiple files from Windows Explorer context menu DateDuration - literal description of the difference between given dates Apps: Touch - set the "modified" timestamp of a file to current time Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes SPDiff - Single-Pane Text Diff
SuleymanTopaloglu Posted June 3, 2018 Posted June 3, 2018 Another trick with WMIC if you know remote computer user credentials. Windows Commandline : WMIC /NODE:*remote computer ip* /USER:*remote computer user name* /PASSWORD:*remote computer password if empty use /PASSWORD:"" * PROCESS CALL CREATE "SHUTDOWN -S -T 0" WMIC /NODE:192.168.1.254 /USER:Administrator /PASSWORD:159753 PROCESS CALL CREATE "SHUTDOWN -S -T 0" Autoit $remoteip = "192.168.1.254" $user = "Administrator" $password "123456" Run("cmd.exe /c " & "WMIC /NODE:"&$remoteip&" /user:"&$user&" /password:"&$password&" process call create 'SHUTDOWN -S -T 0'")
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now