0

Sometimes I run into the wild idea of creating a symbolic link à la Windows using MKLINK. However, that immediately shouts at me that I'm not privileged enough to do so. My user is an admin, but not the admin, I don't mind. You want me to "sudo" a big move (although I'm not here to discuss why creating a link is sensitive to the point to prohibit it without super powers), okay, let's do that!

Okay, then. I know I could reopen a second cmd with admin rights. It doesn't require a password, just to click 'Yes' on the UAC screen.

I wondered, just wondered if there would be a way to stay in the people's cmd -without rights- and run a single command-line, maybe some RUNAS magic, that would allow to run the mklink, like in some sudo mklink fashion, maybe even bringing up the UAC for that single line, but, and that's a very important but, never asking me for the Administrator's password.

I must point out, that I don't want to break the security of my system to get this to work. I already hear one or another suggesting me to remove all my passwords (why would you want one at home? ...) or things like that. Please refrain.

Would you have any clue on how to achieve that? Thanks!

2 Answers 2

0

I know I could reopen a second cmd with admin rights. It doesn't require a password, just to click 'Yes' on the UAC screen.

That is because the user you logged in as is a member of the Admin Group. This is the way for most individual (not Corporate) computers.

if there would be a way to stay in the people's cmd -without rights- ...... never asking me for the Administrator's password.

I interpret this as a Standard User. No. A process requiring Windows security for a Standard User WILL ask for Admin Credentials (password). No native way around this (as you wished) for Windows 10 and 11.

2
  • As written in my question, I was expecting an answer that wouldn't lessen my security. I still want an UAC to execute the mklink. I was merely wondering if I could get that UAC from running the mklink command directly, rather than having to open an admin cmd beforehand. Maybe I should just include the string install, setup or update in an alias of mklink for it to ask automatically for UAC.
    – tomoyo255
    Commented May 24, 2023 at 19:26
  • It works differently in Windows (by default) and the methods outlined are what is available in Windows native default.
    – anon
    Commented May 24, 2023 at 19:48
0

By default, only Windows Administrators can create symbolic links. You may grant this capability to users in the following two ways.

Granting MKLINK permission to a standard user

  • Run gpedit.msc
  • Navigate to Computer Configuration > Windows Settings >Security Settings > Local Policies > User Rights Assignment
  • Double-click the policy named "Create symbolic links"
  • Click the button "Add User or Group..." and add users.

Enabling MKLINK without elevation

From Windows 10 build 14972, symlinks can be created without needing to elevate the console as administrator, by enabling Developer Mode:

  • Run Settings > Update & Security > For developers
  • Turn "Developer Mode" to On.
1
  • Thank you for your suggestions. I'm sure it will enlighten other readers to potential workarounds to this. I'm not expecting that an actual solution exists; I would be lucky if there was. My point is to say that the shortest path to running an mklink is an UAC of opening an Admin cmd. I was asking if we could get the UAC for the mklink command itself rather than a privilege error like a hypothetical uacdo mklink (à la sudo... not actually the same as a sudo, as the latter usually expects the user pw and not that of root for instance, which might not even be configured as Admin's password).
    – tomoyo255
    Commented May 24, 2023 at 19:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .