Giter Club home page Giter Club logo

mslink's Introduction

MsLink

Create and Delete Symbolic Links for Windows. This projects contains the C code to create and delete symbolic links using the Windows API CreateSymbolicLink and various file APIs. Since windows Vista users could use a symbolic link function, a function once only available to Linux users. And if you´re familiar with MinGW or Cygwin, then you may have used their clone of the Unix ln function. However, instead of making a real symbolic link, these clones just copy every file and directory. Not what you were expecting. This simple project should provide two executables, msln.exe and DlLn.exe, to create or delete symbolic links, respectively. Use the command line compiler to compile and link the source files.

A Windows 10 user must meet at least one of the following conditions to be able to use the CreateSymbolicLink function: (1) Run as Adminstrator, (2) Run as a user with administrator privileges, or (3) if a user with non-adminstrator rights must have the Create Symbolic Link privilege added through the Group Policy Editor. Run "gpedit.msc" as an Adminstrator to elevate the privilege level of a non administrator.

To use the Group Policy Editor you must be a member of the Administrator's group or just run gpedit.msc from a Run as Administrator command prompt. You may use the (Windows Command + R) on your Windows keyboard and type in gpedit.msc in the Open input box. You should find the setting to change in the User Rights Assignment section: e.g., Local Computer Policy\Computer Configuration\Windows Settings\Security Settings\Local Policies\User Rights Assignment\Create Symbolic Links. Add the users you wish to have this privilege to this section.

Earlier versions of Windows, e.g. Vista, Windows 7, only allow the user to run this function as Administrator or a standard user with the privilege of creating symbolic links added in the Group Policy Editor. A user belonging to the Administrator's group will fail in its attempt to run this program unless specifically switching to a command prompt run as Administrator. Also, the 'SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE' flag does not run on Vista, or Windows 7. Most likely the flag will not run on Windows 8, but has not been verified. The msln.c file has been coded to take this into account and should run on all operating systems since Windows Vista. Apparently, the SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE flag allows a user in the Adminstrator group to run the program successfully in Windows 10 or later. Not possible with Vista or Windows 7.

To compile this program you must use at least Visual Studio 2013, or possibly Visual Studio 2012, as the VersionHelpers.h header file does not appear in earlier versions.

mslink's People

Contributors

hnkgithub avatar

Stargazers

idk avatar

Forkers

zhangjinde

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.