Jump to content

Custom Windows Shortcut

SlayerOfHellWyrm
Go to solution Solved by SlayerOfHellWyrm,

You make a small mistakes there with the scheduled tasks. They run with the SYSTEM or NETWORK builtin account for Windows, not the builtin Administrator account, so I think that's not really possible.

 

What you can do is:

 

Download PSTools

Unzip it to a folder and add this folder to the Path in System Variables

 

Make a new Administrator user in Windows, make sure it has a password

 

Open notepad and paste this line into it:

 

psexec -user <username> -p <password> cmd.exe

 

Change <username> and <password> into the username and password you just created

 

Save the file as a .bat or .cmd file and assign this to your p1 button (or whatever button you can use for it)

You sir, are a genius. You got me thinking.

 

I had to do a

runas /user:Administrator /savecred

and feed it the password. Then I was able to make a batch file running the same exact command, and attach that to my P1. Gloriousnous, it works. Not the shortcut I wanted, and there's a brief flash of the first command line executing the runas, but I'll take it, since it works. :D

How do I create a shortcut of Win + A, to open an elevated command prompt, without prompting UAC?

"Any sufficiently advanced technology is indistinguishable from magic" - Arthur C. Clarke
Just because it may seem like magic, I'm not a wizard, just a nerd. I am fallible. 


Use the quote button or @<username> to reply to people | Mark solved troubleshooting topics as such, selecting the correct answer, and follow them to get replies!

Community Standards | Guides & Tutorials Troubleshooting Section

Link to comment
Share on other sites

Link to post
Share on other sites

So, I've been looking around online, and as far as I can tell, the only good way to have a shortcut to run Command Prompt as Admin, using the combo Win + A, is to use AutoHotKey. The problem I'm having is when telling it to run the shortcut I created for command prompt, set to always run as admin, the command prompt immediately opens, and then closes.

 

I can get it to work just through Windows, but the shortcut has to be ctrl + alt + a, and I'd rather it be Win + A, as it's much quicker.

 

If anyone knows how to do it in AHK, without having the opened prompt close immediately, or some other method, it'd be greatly appreciated!

I dont get it, what do you want to do :/

My PC:

Spoiler

MOBO: MSI B450 Tomahawk Max, CPU: AMD Ryzen 5 3600, Cooler: BeQuiet! Dark Rock 3, GPU: Gigabyte GTX 1050ti D5 4G, Ram: 16GB (2x8) HyperX Fury DDR4, Case: NZXT S340, Psu: Be Quiet! Pure Power 11 600W , HDD's: WD 1TB Caviar Blue, WD 256GB Scorpio Blue, WD 2TB Caviar Blue  SSD: Sandisk SSD PLUS 240Gb

Link to comment
Share on other sites

Link to post
Share on other sites

I dont get it, what do you want to do :/

A way to make Win + A, a shortcut to run an elevated command prompt, without prompting UAC.

Note, I can do this via the P1 setting on my keyboard, but it prompts UAC, and I'd rather not turn UAC off.

"Any sufficiently advanced technology is indistinguishable from magic" - Arthur C. Clarke
Just because it may seem like magic, I'm not a wizard, just a nerd. I am fallible. 


Use the quote button or @<username> to reply to people | Mark solved troubleshooting topics as such, selecting the correct answer, and follow them to get replies!

Community Standards | Guides & Tutorials Troubleshooting Section

Link to comment
Share on other sites

Link to post
Share on other sites

A way to make Win + A, a shortcut to run an elevated command prompt.

http://www.microsoft.com/hardware/en-gb/help/support/how-to/keyboard/macros

 

try this dunno if it works though, its from microsoft

My PC:

Spoiler

MOBO: MSI B450 Tomahawk Max, CPU: AMD Ryzen 5 3600, Cooler: BeQuiet! Dark Rock 3, GPU: Gigabyte GTX 1050ti D5 4G, Ram: 16GB (2x8) HyperX Fury DDR4, Case: NZXT S340, Psu: Be Quiet! Pure Power 11 600W , HDD's: WD 1TB Caviar Blue, WD 256GB Scorpio Blue, WD 2TB Caviar Blue  SSD: Sandisk SSD PLUS 240Gb

Link to comment
Share on other sites

Link to post
Share on other sites

http://www.microsoft.com/hardware/en-gb/help/support/how-to/keyboard/macros

 

try this dunno if it works though, its from microsoft

That's for MS keyboards with Macro support. I've got an MSI GE60-2OD which has a Steelseries keyboard, and no support for macros. It does have a P1 button that I can program to launch a link for command prompt set to run elevated, but it prompts for UAC, which I want to avoid.

"Any sufficiently advanced technology is indistinguishable from magic" - Arthur C. Clarke
Just because it may seem like magic, I'm not a wizard, just a nerd. I am fallible. 


Use the quote button or @<username> to reply to people | Mark solved troubleshooting topics as such, selecting the correct answer, and follow them to get replies!

Community Standards | Guides & Tutorials Troubleshooting Section

Link to comment
Share on other sites

Link to post
Share on other sites

disable uac? also couldnt you just go into c:/windows/system32/cmd.exe properties and set run as admin there, then any shortcuts to it should run it as admin

How do Reavers clean their spears?

|Specs in profile|

The Wheel of Time turns, and Ages come and pass, leaving memories that become legend. Legend fades to myth, and even myth is long forgotten when the Age that gave it birth comes again.

Link to comment
Share on other sites

Link to post
Share on other sites

" but it prompts UAC, and I'd rather not turn UAC off."

As far as I know, you can only do that with shortcuts, not the actual program (tried, option not available on the actual cmd.exe), but even if I could, I can't set Win + A as a shortcut to launch it, and again, it prompts UAC. Like I quoted/said earlier, I'd rather not turn it off.

"Any sufficiently advanced technology is indistinguishable from magic" - Arthur C. Clarke
Just because it may seem like magic, I'm not a wizard, just a nerd. I am fallible. 


Use the quote button or @<username> to reply to people | Mark solved troubleshooting topics as such, selecting the correct answer, and follow them to get replies!

Community Standards | Guides & Tutorials Troubleshooting Section

Link to comment
Share on other sites

Link to post
Share on other sites

I'm fairly certain that you're not going to be able to have something open and ADMIN level command prompt without a UAC prompt without turning UAC off... I would think that being able to do so would be a giant security hole and defeat the purpose of UAC. 

 

EDIT:

Unless it was a program/script that always ran in the background and had a UAC prompt on launch.

Link to comment
Share on other sites

Link to post
Share on other sites

No, there's ways around it. I know running as a scheduled task bypasses it, since it's run as the system. However, using AHK to map Win + A, to run the scheduled task, opens, and immediately closes the elevated prompt.

"Any sufficiently advanced technology is indistinguishable from magic" - Arthur C. Clarke
Just because it may seem like magic, I'm not a wizard, just a nerd. I am fallible. 


Use the quote button or @<username> to reply to people | Mark solved troubleshooting topics as such, selecting the correct answer, and follow them to get replies!

Community Standards | Guides & Tutorials Troubleshooting Section

Link to comment
Share on other sites

Link to post
Share on other sites

Win+X and click or use the bound key.

Link to comment
Share on other sites

Link to post
Share on other sites

No, there's ways around it. I know running as a scheduled task bypasses it, since it's run as the system. However, using AHK to map Win + A, to run the scheduled task, opens, and immediately closes the elevated prompt.

Yes because it assumes you've given it something to run like a command of some kind it would open it do it then close.

Link to comment
Share on other sites

Link to post
Share on other sites

Win+X and click or use the bound key.

Win + X only opens the options for command prompt, programs and features and so on in Win 8. I'm looking for Win + A, to be a direct launch of an elevated prompt without UAC going off. If I was ok with multiple steps, I wouldn't be asking for a custom shortcut lol :P

"Any sufficiently advanced technology is indistinguishable from magic" - Arthur C. Clarke
Just because it may seem like magic, I'm not a wizard, just a nerd. I am fallible. 


Use the quote button or @<username> to reply to people | Mark solved troubleshooting topics as such, selecting the correct answer, and follow them to get replies!

Community Standards | Guides & Tutorials Troubleshooting Section

Link to comment
Share on other sites

Link to post
Share on other sites

Win + X only opens the options for command prompt, programs and features and so on in Win 8. I'm looking for Win + A, to be a direct launch of an elevated prompt without UAC going off. If I was ok with multiple steps, I wouldn't be asking for a custom shortcut lol :P

Anything needing administrator privileges not launched the administrator will prompt for uac which is why I've had it off on my personal PCs since it launch.

Link to comment
Share on other sites

Link to post
Share on other sites

There's gotta be a work around with a scheduled task to launch the command prompt. If I can at least get that, I can get the rest to work.

"Any sufficiently advanced technology is indistinguishable from magic" - Arthur C. Clarke
Just because it may seem like magic, I'm not a wizard, just a nerd. I am fallible. 


Use the quote button or @<username> to reply to people | Mark solved troubleshooting topics as such, selecting the correct answer, and follow them to get replies!

Community Standards | Guides & Tutorials Troubleshooting Section

Link to comment
Share on other sites

Link to post
Share on other sites

You make a small mistakes there with the scheduled tasks. They run with the SYSTEM or NETWORK builtin account for Windows, not the builtin Administrator account, so I think that's not really possible.

 

What you can do is:

 

Download PSTools

Unzip it to a folder and add this folder to the Path in System Variables

 

Make a new Administrator user in Windows, make sure it has a password

 

Open notepad and paste this line into it:

 

psexec -user <username> -p <password> cmd.exe

 

Change <username> and <password> into the username and password you just created

 

Save the file as a .bat or .cmd file and assign this to your p1 button (or whatever button you can use for it)

Currently working on a Watercooled Corsair Obsidian 350D (clicky)


Intel i5 4670k, ASUS GTX 780, Samsung 840 Evo, 16GB RAM, 3 TB Seagate HDD

Link to comment
Share on other sites

Link to post
Share on other sites

You make a small mistakes there with the scheduled tasks. They run with the SYSTEM or NETWORK builtin account for Windows, not the builtin Administrator account, so I think that's not really possible.

 

What you can do is:

 

Download PSTools

Unzip it to a folder and add this folder to the Path in System Variables

 

Make a new Administrator user in Windows, make sure it has a password

 

Open notepad and paste this line into it:

 

psexec -user <username> -p <password> cmd.exe

 

Change <username> and <password> into the username and password you just created

 

Save the file as a .bat or .cmd file and assign this to your p1 button (or whatever button you can use for it)

Forgot about SysInternals, and that thought never even crossed my mind. You're the closest so far, since that does bypass UAC, and open it. Only issue is the original command window gets left open.

"Any sufficiently advanced technology is indistinguishable from magic" - Arthur C. Clarke
Just because it may seem like magic, I'm not a wizard, just a nerd. I am fallible. 


Use the quote button or @<username> to reply to people | Mark solved troubleshooting topics as such, selecting the correct answer, and follow them to get replies!

Community Standards | Guides & Tutorials Troubleshooting Section

Link to comment
Share on other sites

Link to post
Share on other sites

You make a small mistakes there with the scheduled tasks. They run with the SYSTEM or NETWORK builtin account for Windows, not the builtin Administrator account, so I think that's not really possible.

 

What you can do is:

 

Download PSTools

Unzip it to a folder and add this folder to the Path in System Variables

 

Make a new Administrator user in Windows, make sure it has a password

 

Open notepad and paste this line into it:

 

psexec -user <username> -p <password> cmd.exe

 

Change <username> and <password> into the username and password you just created

 

Save the file as a .bat or .cmd file and assign this to your p1 button (or whatever button you can use for it)

You sir, are a genius. You got me thinking.

 

I had to do a

runas /user:Administrator /savecred

and feed it the password. Then I was able to make a batch file running the same exact command, and attach that to my P1. Gloriousnous, it works. Not the shortcut I wanted, and there's a brief flash of the first command line executing the runas, but I'll take it, since it works. :D

"Any sufficiently advanced technology is indistinguishable from magic" - Arthur C. Clarke
Just because it may seem like magic, I'm not a wizard, just a nerd. I am fallible. 


Use the quote button or @<username> to reply to people | Mark solved troubleshooting topics as such, selecting the correct answer, and follow them to get replies!

Community Standards | Guides & Tutorials Troubleshooting Section

Link to comment
Share on other sites

Link to post
Share on other sites

You sir, are a genius. You got me thinking.

 

I had to do a

runas /user:Administrator /savecred

and feed it the password. Then I was able to make a batch file running the same exact command, and attach that to my P1. Gloriousnous, it works. Not the shortcut I wanted, and there's a brief flash of the first command line executing the runas, but I'll take it, since it works. :D

 

Thought I read that to somewhere, but the last time I tested that (WinXP) I had to re-enter my password everytime I rebooted.

Currently working on a Watercooled Corsair Obsidian 350D (clicky)


Intel i5 4670k, ASUS GTX 780, Samsung 840 Evo, 16GB RAM, 3 TB Seagate HDD

Link to comment
Share on other sites

Link to post
Share on other sites

Thought I read that to somewhere, but the last time I tested that (WinXP) I had to re-enter my password everytime I rebooted.

Depends on the security policy, I suppose. For me, I don't have it clearing credentials, so the Administrator account credentials are permanently saved on my account, until something else removes them, or I manually remove them.

"Any sufficiently advanced technology is indistinguishable from magic" - Arthur C. Clarke
Just because it may seem like magic, I'm not a wizard, just a nerd. I am fallible. 


Use the quote button or @<username> to reply to people | Mark solved troubleshooting topics as such, selecting the correct answer, and follow them to get replies!

Community Standards | Guides & Tutorials Troubleshooting Section

Link to comment
Share on other sites

Link to post
Share on other sites

Depends on the security policy, I suppose. For me, I don't have it clearing credentials, so the Administrator account credentials are permanently saved on my account, until something else removes them, or I manually remove them.

 

Cool than I've learned something too :D

Currently working on a Watercooled Corsair Obsidian 350D (clicky)


Intel i5 4670k, ASUS GTX 780, Samsung 840 Evo, 16GB RAM, 3 TB Seagate HDD

Link to comment
Share on other sites

Link to post
Share on other sites

Forgot about SysInternals, and that thought never even crossed my mind. You're the closest so far, since that does bypass UAC, and open it. Only issue is the original command window gets left open.

Just add in a exit command to the bat file.

Link to comment
Share on other sites

Link to post
Share on other sites

Just add in a exit command to the bat file.

I have a feeling you've not made many a batch file :P

Adding in an exit command, would simply cause the original to close, upon ending the elevated prompt, which it would do anyway. This is because once a program is called from a command prompt, the calling prompt does not regain control, and thus cannot execute commands via a batch file, until the called program has exited, and returned control.

That, and even knowing this I tried it, only to have the exact thing I stated above happen.

"Any sufficiently advanced technology is indistinguishable from magic" - Arthur C. Clarke
Just because it may seem like magic, I'm not a wizard, just a nerd. I am fallible. 


Use the quote button or @<username> to reply to people | Mark solved troubleshooting topics as such, selecting the correct answer, and follow them to get replies!

Community Standards | Guides & Tutorials Troubleshooting Section

Link to comment
Share on other sites

Link to post
Share on other sites

I have a feeling you've not made many a batch file :P

Adding in an exit command, would simply cause the original to close, upon ending the elevated prompt, which it would do anyway. This is because once a program is called from a command prompt, the calling prompt does not regain control, and thus cannot execute commands via a batch file, until the called program has exited, and returned control.

That, and even knowing this I tried it, only to have the exact thing I stated above happen.

nope not too much stuff. This is the hardest thing I did http://pastebin.com/0ZMw8Pi8 and most of the other stuff it just to speed up certain tasks.

Link to comment
Share on other sites

Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×