Jump to content
Sign in to follow this  
jp10558

FileSetAttribute in C:\Program Files?

Recommended Posts

jp10558

I need to change a file from read only that's installed with an MSI installer. So far I can run the MSI silently, but I'm wondering how I change the file attribute of a file in

C:\Program Files (x86)\Program\file

with FileSetAttribute when it says the file match can't contain spaces ...?

Share this post


Link to post
Share on other sites
Spiff59

The helpfile needs an update, the function works with both directories with spaces in their names, and filenames containing spaces.

Edited by Spiff59

Share this post


Link to post
Share on other sites
Fire

BTW you can use this way too.

RunWait("cmd.exe /c " & "attrib -R -H -S " & """" & @ProgramFilesDir&"\file\somefile.exe" & """",@ScriptDir,@SW_HIDE)

or

RunWait("cmd.exe /c " & "attrib -R -H -S " & """" & "%programfiles%\file\somefile.exe" & """",@ScriptDir,@SW_HIDE)

This works for me in win xp sp2

edit:spell

Edited by Sh3llC043r

[size="5"] [/size]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×