10-28-2013 07:07 AM
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
Solved! Go to Solution.
10-28-2013 07:18 AM
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.
10-28-2013 08:08 AM
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