Copying files into the Windows Vista Program Files folder
One of the many annoying things when working with Windows Vista is the way the operating system protects certain directories, as part of the many security enhancements now built into Vista. For the average user, this is probably a good thing, but for any IT professional or developer who needs to test and tweak files all over the place, it can be a huge inconvenience. I use the following steps as the quickest way around this:
- Open up a privileged command line prompt. Type “cmd” into the Start Search box (the “run” box in previous versions of Windows), and hit Ctrl+Shift + Enter (as opposed to just the Enter key). A User Account Control dialog window will pop up. Click the continue button or use the Alt-C keyboard shortcut. Thanks to the How-To geek for this tip.
- Take ownership of the directory into which you wish to copy files with this command: takeown /f “directory name”
- Grant yourself full control of the same directory with this command: cacls “directory name” /G user account:F
- Use the robocopy command (now included with Vista) to copy the files or folders, or launch Windows explorer from this privileged command prompt with this command: explorer
If you need to do this often with the same files, the commands can be put into a batch file that can be run as administrator. The commands takeown and cacls are also useful for deleting or overwriting system or other protected files. A complete list of Windows Vista and Server 2008 commands can be found here.
Related Posts:
Windows Power Users: Unleash your Inner Unix!
Comments
Leave a Reply









