LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

'File permission error' during file deletion on Windows 7

Solved!
Go to solution

Hi,

 

I am running Labview 2011 and have an application which was originally developed to run on Windows XP. The part of the application deletes a file from the System32 folder and then replaces it with another version of the same file (based on a particular condition). This worked perfectly well on Windows XP. Now that I have migrated to Windows 7, I changed the path to access the SysWOW64 folder, where the same file now resides. Now when I run the program, during the deletion phase I get the following error:

 

Possible reason(s):

LabVIEW:  File permission error. You do not have the correct permissions for the file.

 

When I manually try to delete the file from the SysWOW64 folder, I get a popup to confirm the deletion progress. The file then gets deleted.

 

Is there anyway I can get the permission to delete the file done automatically? I also tried to use the 'Set permission' VI with the permission set to 511 (777 octal) but that VI also threw up the same File permission error.

 

Any help would be greatly appreciated.

 

Thanks,

Arun

 

 

0 Kudos
Message 1 of 3
(2,852 Views)
Solution
Accepted by topic author aruntutu

Try running your application with the "Run As Administrator".  Windows 7 is very restrictive about who can do what.  It is generally a bad idea to have applications deleting file from a system folder.  I think you should consider using a temporary directory to avoid this issue.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 3
(2,847 Views)

Hi Crossrulz,

 

Thank you for your prompt reply. The problem is that this file in the SysWOW64 folder would need to be 'refreshed' everytime we run a different instance of the tool (we test different devices and for every device, we need the file to be refreshed with the contents for the new device). This file resides in the system folder.

 

"Run as administrator" along with "Run this program in compatibility mode for Windows XP (Service Pack 3)" seems to have done the trick. The program now is operating the way it should have in the first place.

 

Thanks!

 

--Arun

0 Kudos
Message 3 of 3
(2,831 Views)