Jump to content

Create a shortcut in Users\Public\Desktop

Recommended Posts


Because RSAT keeps getting uninstalled when windows installs new updates on the machine I am currently building a script to install it again when the monitor detect its missing.

The scripts works just fine except one thing. Creating the shortcut with nircmd from nirsoft.

In the end of the script I want to put a shortcut to Active Directory Users and Computers to the public desktop (C:\Users\Public\Desktop).

When I do this manually in a CMD I have to right click on CMD and choose run as admin otherwise it will not work, even if the user is local admin on the machine.

With a normal shell in the script I get a OK on that command but it will then fail in the section where the script check if the shortcut is present or not.

With a shell as admin in the script I get a failed login as user when trying to create the shortcut. Do I have to have a valid domain admin or local admin account at the location for this to work?

I have got the script to work 100% but only if I but the shortcut at C:\Users\%username%\desktop but then the user needs to be logged on to the computer for the script to complete.

Can I manage to do the right click and run as admin in the script?

Thanks in advanced! 

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...