2016年8月1日 星期一

password protect exe

http://superuser.com/questions/896562/how-to-set-a-password-for-program-application-in-windows-8


Doing it the windows way.

Creating a useraccount

  1. Go to control paneladministrative toolsComputer management
  2. Open System ToolsLocal Users and GroupsUsers
  3. Right click Create new user
  4. Give it a username and password

Assigning rights

  1. Open your explorer and navigate to the place you want to set the rights. Do note not to set these rights on the actual shortcut, but on the folder or program itself, otherwise you cannot use the run-as function.
  2. Rightclick the Application (.exe) file and choose properties.
  3. Go to the tab Security
  4. Click Advanced
  5. Click Change Permissions...
  6. Uncheck `Include inheritable permiisions from this object's parent
  7. Click Add
  8. Click OK twice
  9. Click Edit...
  10. Remove everything except SYSTEM and possibly Administrators, depending on what you want (Administrators will allow you to right click, run as administrator) but remove Administrators if you don't want this. SYSTEM should be there though.
  11. Add the newly created password user.
  12. Give this newly created user Full Control access by clicking it, then clicking the AllowCheckbox next to Full Control.
  13. Double check that everything is as it should be. Clicking OK will stop you from being able to make any changes.
  14. Click Apply and/or OK

Testing and using it

If you now doubleclick the icon, it will tell you the following:
[Window Title] C:\path\to\executable.exe
[Content] Windows cannot access the specified device, path, or file. You may not have the appropriate permissions to access the item.
[OK]
To start the program, shift rightclick either the program or its shortcut, and choose run as different user. You will get a prompt to enter the username and password and by doing this correctly the program will start.

Creating a shortcut that will ask you for the password upon clicking

If the above is not good enough and you want to get asked for a password every time you use this link, do the following.
  1. Right click, create new file->textfile
  2. Give it the following name: YourApp.cmd (where YourApp is a name that tells you which program it will start.
  3. If it says: Are you sure you want to change the extension, say yes. (if it doesn't say this, then you have hide known extensions enabled.)
  4. Rightclick the shortcut you already had, and copy the text after "Target"
  5. Rightclick your YourApp.cmd file and choose edit.
  6. Type: runas /user:username and paste the text you copied earlier after target. username is the name you gave the account with password.
  7. Save and close and double click the YourApp.cmd. If done correctly, it will give you a black console window asking to type a password and once correct, it will start your program.

Last word

Using this technique will create a new useraccount with password. When you boot your computer, you will be able to login to this account using that password. This will allow you to launch the program without entering the password, and edit the rights back to how they were before.


http://www.makeuseof.com/tag/how-to-password-protect-any-windows-program/

http://forum.tutorials7.com/568/how-to-protect-exe-files-with-password

沒有留言:

張貼留言

注意:只有此網誌的成員可以留言。