#368230 - 19/01/2017 20:28
Windows 10 runas shortcuts and command prompts.
|
carpal tunnel
Registered: 08/06/1999
Posts: 7868
|
I'm looking for a way to create a shortcut that runs a program as a different user. Windows has a command called "runas" serviced by the secondary login service.
If I right click a shortcut while holding shift, the option "run as different user" appears and lets me type in the name and password of the account to run the shortcut as.
I'd like to have the shortcut do that all the time when it's normally involved. Double clicking, start menu, etc, I want it to pop the dialog "run as different user" presents.
I found the runas command in the command prompt, and made a shortcut using it. However this method requires the username to be coded into the command line arguments for runas, and wants password entry to be done in a cmd window instead of a GUI dialog. Or if /savecred is used, the password only needs to be keyed in once, which is also not the behavior I'm looking for.
Is there a method to have a shortcut to an executable always invoke run as different user complete with the GUI prompt for username/password?
|
Top
|
|
|
|
#368231 - 19/01/2017 20:33
Re: Windows 10 runas shortcuts and command prompts.
[Re: drakino]
|
carpal tunnel
Registered: 20/12/1999
Posts: 31600
Loc: Seattle, WA
|
Back before they built this feature into Windows 8 and later, there used to be a registry hack you could add which would add a right-click menu to Explorer folders, which would give you an option to "Open Command window here as administrator" when you right-clicked in or on a folder.
I wonder if that would have some clues as to how to do it.
|
Top
|
|
|
|
#368232 - 19/01/2017 20:36
Re: Windows 10 runas shortcuts and command prompts.
[Re: drakino]
|
carpal tunnel
Registered: 20/12/1999
Posts: 31600
Loc: Seattle, WA
|
|
Top
|
|
|
|
#368233 - 19/01/2017 20:48
Re: Windows 10 runas shortcuts and command prompts.
[Re: tfabris]
|
carpal tunnel
Registered: 08/06/1999
Posts: 7868
|
The Powershell path looks like it will work. I should be able to create a shortcut around that.
ShellRunAs looks interesting too, and might work to let me skip invoking Powershell from a shortcut. I'll go with that path if the powershell one pops a visible window when it is run.
Mostly looking to get this going so I can invoke a Windows specific admin tool in my Windows as a VM on macOS setup. Shortcuts translate over to the Mac side as applications I can run like any other Mac app, and they can start up the needed VM if it's not running at the time. Combined with unity view, I get what looks to be Windows apps running without Windows on the Mac.
|
Top
|
|
|
|
#368234 - 19/01/2017 22:06
Re: Windows 10 runas shortcuts and command prompts.
[Re: drakino]
|
carpal tunnel
Registered: 08/06/1999
Posts: 7868
|
As an aside, I'm glad to see Windows 10/Server 2016 consoles gain these features: https://technet.microsoft.com/en-us/library/mt427362.aspxTurning on line selection mode and linewrap on may bring some quality of life improvements to anyone else out there doing work in the console.
|
Top
|
|
|
|
#368235 - 19/01/2017 22:44
Re: Windows 10 runas shortcuts and command prompts.
[Re: drakino]
|
carpal tunnel
Registered: 20/12/1999
Posts: 31600
Loc: Seattle, WA
|
Agreed. I'm happy to see these console features. I'm disappointed how many major OS revisions it took them to get there.
The single simple feature of being able to freely resize a console window didn't exist until Windows 10, it's crazy.
|
Top
|
|
|
|
#368236 - 20/01/2017 02:28
Re: Windows 10 runas shortcuts and command prompts.
[Re: tfabris]
|
carpal tunnel
Registered: 08/03/2000
Posts: 12341
Loc: Sterling, VA
|
The single simple feature of being able to freely resize a console window didn't exist until Windows 10, it's crazy. I might be misunderstanding what you mean by that. I thought that was possible in 7... BTW, I'm slowly being driven to OSX by Windows 10. It is NOT a good feeling to know that I can't expect to have my windows open when I come back to my computer because Microsoft is being FAR too aggressive with their updates and I'm sick of it. They let you set "active hours," but for some bizarre reason those can only be 12 hours long! What the hell? I regularly work during the day, take a break in the evening to be with the family, then come back to work at night. It's not fun to come back and find that all my browser windows and temporary work has been wiped out.
_________________________
Matt
|
Top
|
|
|
|
#368238 - 20/01/2017 11:49
Re: Windows 10 runas shortcuts and command prompts.
[Re: Dignan]
|
veteran
Registered: 25/04/2000
Posts: 1529
Loc: Arizona
|
It is NOT a good feeling to know that I can't expect to have my windows open when I come back to my computer because Microsoft is being FAR too aggressive with their updates and I'm sick of it. They let you set "active hours," but for some bizarre reason those can only be 12 hours long! I wonder if the metered network trick that prevents updates from automatically downloading also prevents the machine from restarting?
|
Top
|
|
|
|
#368239 - 20/01/2017 12:58
Re: Windows 10 runas shortcuts and command prompts.
[Re: drakino]
|
old hand
Registered: 01/10/2002
Posts: 1039
Loc: Fullerton, Calif.
|
I guess there's a reason you can still buy new computers with win 7 installed. Figuring this may be my last chance to buy a windows system that actually works, I got the very top of the line Dell laptop with Win 7 pro just a week ago.
|
Top
|
|
|
|
#368240 - 20/01/2017 14:34
Re: Windows 10 runas shortcuts and command prompts.
[Re: larry818]
|
carpal tunnel
Registered: 08/03/2000
Posts: 12341
Loc: Sterling, VA
|
I guess there's a reason you can still buy new computers with win 7 installed. Figuring this may be my last chance to buy a windows system that actually works, I got the very top of the line Dell laptop with Win 7 pro just a week ago. Unfortunately you only have three years until they stop releasing patches, although I'd guess that they'll extend that like they did for XP.
_________________________
Matt
|
Top
|
|
|
|
#368241 - 20/01/2017 19:23
Re: Windows 10 runas shortcuts and command prompts.
[Re: Dignan]
|
carpal tunnel
Registered: 20/12/1999
Posts: 31600
Loc: Seattle, WA
|
It is NOT a good feeling to know that I can't expect to have my windows open when I come back to my computer because Microsoft is being FAR too aggressive with their updates and I'm sick of it. I haven't looked this up, but, I wonder how they handle situations where a Windows 10 computer is being used for a Kiosk, signage/display, or some other similar situation. For instance, I'm still using a Windows tablet for my chord charts on stage. To have it reboot for updates (or even pop up a "need to reboot for updates" dialog box) during a performance would be a train wreck. As it is in Windows 8, I had to work pretty hard to make sure that most of those popups were gone, and I'm not even certain I nailed them all.
|
Top
|
|
|
|
#368242 - 20/01/2017 19:25
Re: Windows 10 runas shortcuts and command prompts.
[Re: Dignan]
|
carpal tunnel
Registered: 20/12/1999
Posts: 31600
Loc: Seattle, WA
|
The single simple feature of being able to freely resize a console window didn't exist until Windows 10, it's crazy. I might be misunderstanding what you mean by that. I thought that was possible in 7... I think you could change the HEIGHT of a command window, but not the width. Only in Windows 10 can you freely resize a command window in both the X and y dimensions and have it automatically fix the line-wrap.
|
Top
|
|
|
|
#368243 - 20/01/2017 20:53
Re: Windows 10 runas shortcuts and command prompts.
[Re: drakino]
|
old hand
Registered: 01/10/2002
Posts: 1039
Loc: Fullerton, Calif.
|
You have to change the font, then it'll make the window wider.
|
Top
|
|
|
|
|
|