If you specify a non-executable file, Start-Process starts the program that is associated with the file, much like the Invoke-Item cmdlet. To specify the program that runs in the process, enter an executable file or script file, or a file that can be opened by using a program on the computer. Starts one or more processes on the local computer. Type in Run: powershell Start-Process cmd -Verb runAs You can use this Windows PowerShell command Start-Process cmd -Verb runAs as powershell.exe's argument in Run. (²strictly speaking it's admin-prompt.lnk, but that extension is a known executable extension, just like bat or cmd, so it may be ommited when calling this shortcut).ħ) Optional : Revisit the properties of your admin-prompt Link, colors tab and style the background to a mild red, so you can distinguish regular and admin prompts on your screen. (C:\Windows\System32, if you are out of inspiration) admin-promptĤ) admin properties: Open admin-prompt(.lnk) file properties, Shortcut Tab, Advanced: Run as administratorĥ) Copy the generated admin-prompt² into a directory, somewhere in your path. (Note: right-click-dragging from System32/cmd.exe is strangely not going to work, regarding the admin rights later on).Ģ) Enter Location ( /k and what follows is just optional inspiration, if you like a directory switch and listing to start with) %windir%\system32\cmd.exe /k "cd D:\depot\pathOfYourLiking & dir /B"ģ) Name shortcut. lnk file with an exceptionally well hidden extension. 1) Create a shortcut: Right-click on your desktop (or elsewhere) to create a link („New Shortcut“).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |