How to associate a program with a file type, but only for the current user?

If you want to register the association for every user, write your data to HKEY_LOCAL_MACHINE\Software\Classes If you want to register the association for the current user only, write your data to HKEY_CURRENT_USER\Software\Classes This is how to do the latter: with TRegistry.Create do try RootKey := HKEY_CURRENT_USER; if OpenKey(‘\Software\Classes\.myfile’, true) then WriteString(”, ‘MyAppDataFile’); if OpenKey(‘\Software\Classes\MyAppDataFile’, true) … Read more

Disabling UAC programmatically

Set the EnableLUA DWORD value in HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System to 0 and reboot. this will disable UAC without a problem, i would do it to all your users, with or without permission is up to you, because the vista UAC is so horrid that i do believe the less people that have it on the better (in … Read more

python IDLE shell appears not to handle some escapes correctly

What am I doing wrong or what should I be looking for? Is it reasonable to expect backspace, specifically, to work? No, IDLE does not support backspace, nor carriage-return, nor formfeed, nor ANSI escape sequences. You are expecting \b to move the cursor one cell to the left in IDLE’s interactive shell window. It doesn’t … Read more

How do you run a command as an administrator from the Windows command line?

All you have to do is use the runas command to run your program as Administrator (with a caveat). runas /user:Administrator “cmdName parameters” In my case, this was runas /user:Administrator “cmd.exe /C %CD%\installer.cmd %CD%” Note that you must use Quotation marks, else the runas command will gobble up the switch option to cmd. Also note … Read more

Why do files get placed in “C:\Users\AppData\Local\VirtualStore\Program Files(x86)”?

An application that is not running with raised privileges should does not have access to the Program Files and Program Files (x86) directories. This is good for safety. In addition, in most cases when a developer tells his program to save data in the Program Files folder, for example, program settings, he has completely forgotten … Read more

Request Windows Vista UAC elevation if path is protected?

The best way to detect if they are unable to perform an action is to attempt it and catch the UnauthorizedAccessException. However as @DannySmurf correctly points out you can only elevate a COM object or separate process. There is a demonstration application within the Windows SDK Cross Technology Samples called UAC Demo. This demonstration application … Read more

tech