shortcut from network drive to local machine

Gareth Davies 276 Reputation points
2021-03-01T20:45:50.317+00:00

I need to work out if is is possible to set up a shortcut on a network shared drive (on a Windows server 2016 file server) that points back to a file on the host machine the user is logged in to.

So, if I log on to machine A and click the link it needs to open a folder in \machineA\C$:\users\%username%\
If a user logs on from machine B and clicks the link it needs to open \machineb\c$\users\%username%\

If I set the shortcut to use \%localhost%\c$:\users\%username%\ it tells me the target is not valid. it only seems to want to work if I set an actual machine name, as in \machinea\c$:\users\%username%\ but this will not work for obvious reasons.

So, does anyone know if this is possible and, if it is, how do I format the path for the shortcut?

The idea is basically to make the users start using Sharepoint without going through the process of training and reminding them all to use this rather than the current process. The Sharepoint data will be synced to each machine and the shortcut will redirect them to the locally synced folder.

Windows for business | Windows Server | User experience | Other
Windows for business | Windows Client for IT Pros | User experience | Other
{count} votes

Accepted answer
  1. Gareth Davies 276 Reputation points
    2021-03-02T15:31:54.58+00:00

    So I have found using localhost works as long as you do not want to also use %username%, doing this rewrites the shortcut so it looks for the username of the person that created the shortcut. Clearly this is not going to work in my situation.

    What DOES work is using "%USERPROFILE%\<Parent Folder>\<Child Folder>\"
    This has been tested and is working as I type on multiple test machines for multiple users.

    0 comments No comments

4 additional answers

Sort by: Most helpful
  1. Anonymous
    2021-03-01T20:51:40.387+00:00

    Try putting the string in a batch and call the batch from shortcut.

    --please don't forget to Accept as answer if the reply is helpful--


  2. Anonymous
    2021-03-01T21:10:35.603+00:00

    Seems to work here
    explorer.exe \%localhost%\c$\users\%username%\


  3. MotoX80 36,401 Reputation points
    2021-03-01T23:05:13.583+00:00

    There is no need to use %localhost% or C$. Since the user has logged on to the desktop, you just need to refer to the C:\ drive.

    Set the shortcut to C:\users\%username%

    0 comments No comments

  4. Anonymous
    2021-03-02T08:36:57.963+00:00

    Hi,

    "localhost" is not an environment variable. Try setting the shortcut to \localhost\c$\users\%username%\

    Best Regards,
    Ian Xue

    ============================================

    If the Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.