I have a PERL script that installs software on a PC by copying files into the Program Files (X86) directory. I’ve run this from a Command Prompt. for years without troubles on Windows XP.
But when run on Windows 7, Access Denied error messages display for every file the PERL script attempts to copy.
One way I found to solve this problem is to set my Command Prompt to run as administrator. Do that as follows:
- Right-click your Command Prompt shortcut. This causes the Command Prompt Properties window to appear.
- Click the Shortcut tab in that window. The available options in the window change accordingly.
- Click the Advanced button. The Advanced Properties window then appears.
- Make sure the Run As Administrator checkbox is checked.
- Press the OK button to close the Advanced Properties window. This action once again reveals the Command Prompt Properties window.
- Then, back in the Command Prompt Properties window, click the Apply button.
- Finally, press the OK button. This closes the Command Prompt Properties window.
Now, when you open a Command Prompt, you’ll be prompted by Windows 7, asking if you want to allow this program to make changes to your computer. Press the Yes button. This closes the UAC window and takes you into the new Command Prompt window just opened. Now you’re running it as an administrator.
At this point, I was able to run the heretofore offending PERL scripts in this Command Prompt window without further Access Denied error messages.
Be careful not to run other commands in this “super user” authorized Command Prompt window, lest you risk serious damage to your computer if the program(s) you run turn out to be malware.
Related Posts and Links