Solving Access Denied Errors in File Copying PERL Scripts in Windows 7

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.

 

Problem:

But when run on   Windows 7,   Access Denied  error messages display for every file the PERL script attempts to copy.

 

Solution:

One way I found to solve this problem is to set my Command Prompt to run as administrator.  Do that as follows:

  1. Right-click your Command Prompt shortcut.  This causes the Command Prompt Properties window to appear.
  2. Click the Shortcut tab in that window.  The available options in the window change accordingly.
  3. Click the Advanced   button.  The Advanced Properties window then appears.
  4. Make sure the Run As Administrator checkbox is checked.
  5. Press the OK button to close the Advanced Properties window.  This action once again reveals the Command Prompt Properties window.
  6. Then, back in the Command Prompt Properties window, click the Apply button.
  7. 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.

Tom Hesley

Related Posts and Links

 

3 thoughts on “Solving Access Denied Errors in File Copying PERL Scripts in Windows 7

  1. Pingback: Toms Diary - Copying DTBs To NLS Player Cartridges

  2. Pingback: Toms Diary - Folder Sync Program

  3. Pingback: Toms Diary - Todays Business - 2011-08-31

Leave a Reply