Jump to content

Recommended Posts

Posted

:) This must be really simple but I can't work it out

all Ii want to do is change the file attribute to read only but without hard coding the drive letter.

if I use the following code it works ok

FileSetAttrib("c:\program files\Webroot\Spy Sweeper\test.ini","+R")

If @error Then MsgBox(4096,"Error", "Problem setting attributes."

but use this and it want set it to read only

$varhome = @ProgramFilesDir

FileSetAttrib("$varhome &\Webroot\Spy Sweeper\test.ini","+R")

If @error Then MsgBox(4096,"Error", "Problem setting attributes."

any idears ?

Posted (edited)

$varhome = @ProgramFilesDir

FileSetAttrib("$varhome &\Webroot\Spy Sweeper\test.ini","+R")

If @error Then MsgBox(4096,"Error", "Problem setting attributes."

$varhome = @ProgramFilesDir
FileSetAttrib($varhome & "\Webroot\Spy Sweeper\test.ini","+R")
If @error Then MsgBox(4096,"Error", "Problem setting attributes.")
Edited by scriptkitty

AutoIt3, the MACGYVER Pocket Knife for computers.

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...