At bare minimum, evaluate the software carefully before running it. And it's bad practice to run 3rd party software that is not on the organization's approved list at work. Just don't. Then it works also when the batch file is invoked from a drive other than the default one for cmd usually C:. David Rodriguez David Rodriguez 2, 1 1 gold badge 16 16 silver badges 14 14 bronze badges. To get this to work you must edit the properties of psexec. But psexec causes issues with the tab key in the cmd.
Can't use tab to complete folder names. Not sure on which environment you tried but I didn't need to change the "Run as Administrator" setting are you trying to run the cmd. Also no issues with tab key, I can successfully complete files and folders names at least tested on Win8. I'm using Win10 and running it locally. Not sure why it happens to me and not you. I did get nircmd to work and it doesn't cause tab issue.
I also notice that one can't autocomplete with the tab key, but at least this would open elevated cmd prompt in context of another user, which previous methods above did not seem to achieve when I tried. The '-h' flag is great windows 10 , works a treat. Ogmios Ogmios 6 6 silver badges 12 12 bronze badges. I unfortunately can't reproduce this. Whenever I use either of my solutions. Stefan Gadecki Stefan Gadecki 51 1 1 silver badge 1 1 bronze badge. The command line inside his sudo. Now right-click in any folder and you will see your item there within the other items.
Shadow Lynx Shadow Lynx 21 1 1 bronze badge. For fans of Cygwin: cygstart -a runas cmd. This is what I was looking for Elevate the user itself as the admin instead of calling the Administrator. But I don't understand what's going on there Why does this thing end up asking for administrative privilege? Michel de Ruiter Michel de Ruiter 5, 5 5 gold badges 44 44 silver badges 64 64 bronze badges. Can you please explain, what each of the arguments does?
To answer the original question- type admin cmd in standard cmd. Right click on Administrator and select Properties.
Check Password never expires. Uncheck Account is Disabled and everything else then click OK. This will enable administrator account on your system. Skip if already enabled. Again Right click on Administrator and click on Set Password by default it has no password set but for runas command to work we need to set a password.
Now windows will show you a life threatening warning which you can accept. OR If you want to play safe then you should login into it after enabling this account and set a password from there. Jeter-work Jeter-work 7 7 silver badges 20 20 bronze badges. This is my workaround. Hope this helps someone if not the original poster. Gareth Gareth 49 1 1 gold badge 1 1 silver badge 6 6 bronze badges. Missing Twins Missing Twins 21 3 3 bronze badges.
Can use a temporary environment variable to use with an elevated shortcut start. Jee Mok 5, 8 8 gold badges 44 44 silver badges 68 68 bronze badges. Sean Golash Sean Golash 1 1 1 bronze badge. Harish Regada Harish Regada 1 2 2 bronze badges. DzmitryLahoda can you brief me the error that you got?
Trooper Z 1, 12 12 silver badges 28 28 bronze badges. Tom Tom 1. And the account calling the tool must also have admin.
Example of use: ExecuteElevated. MrCalvin MrCalvin 1, 14 14 silver badges 21 21 bronze badges. I just love the answers with "This might work haven't tested yet", and of course the one with "not sure" Link reestablished, sorry for that — MrCalvin. Yeah, at least post the source code to these things. Show 1 more comment.
JasonC JasonC 19 1 1 silver badge 7 7 bronze badges. It requires the credentials of another user. If you're already Administrator and want to run with elevated privileges like when you right click an application and choose run as administrator and no password is requested, just a confirmation dialog, then you need something else. I came here searching for that answer but doesn't seem to be here. Matt Matt 1, 4 4 gold badges 18 18 silver badges 31 31 bronze badges.
This is not the same thing as running an elevated command, because when I open an elevated cmd window and I type "whoami" it brings the same result as a non elevated window. Type cmd and press Enter. You need to turn User account control on to get administrator privilege. Hope this information is helpful and let me know if you need any further assistance. Visit our Microsoft Answers Feedback Forum and let us know what you think.
Was this reply helpful? Yes No. Sorry this didn't help. Thanks for your feedback. John'z Place. Step 2. In the elevated window, type the desired commands and hit Enter. A great many Windows 10 users reported that microphone keeps muting itself. Have you come across the error? This post will provide you with several solutions. If there are any corrupted system files, you may encounter the error.
For that, you can run System File Checker to repair the corrupted files. Boot your computer into Safe Mode.
Run Command Prompt as an administrator through the steps in Solution 1. Step 3. This process may take you much time to scan, please wait patiently.
Follow the on-screen prompts to complete this operation.
0コメント