Rex Posted July 23, 2005 Posted July 23, 2005 Hi, i'm useing Bart's PE Builder to build system cd's But but, when i run a script from the cd to do a copy, runwait > delete files the script don't delete the files.. But if i then copy the script to the Ramdrv the script works fine. Can some one tell me how to get arount this prob.
GaryFrost Posted July 23, 2005 Posted July 23, 2005 Rex said: Hi, i'm useing Bart's PE Builder to build system cd'sBut but, when i run a script from the cd to do a copy, runwait > delete files the script don't delete the files..But if i then copy the script to the Ramdrv the script works fine.Can some one tell me how to get arount this prob.<{POST_SNAPBACK}>When copying from cd the files will have read-only attribute set, just use the FileSetAttrib function on the files after copying to drive:From help file Quote FileSetAttrib --------------------------------------------------------------------------------Sets the attributes of one or more files.FileSetAttrib ( "file pattern", "+-RASHNOT" [, recurse]) Parametersfile pattern File(s) to change, e.g. C:\*.au3, C:\Dir +-RASHNOT Attribute(s) to set/clear. e.g. "+A", "+RA-SH" recurse [optional] If this is set to 1, then directories are recursed into. Default is 0 (no recursion). Return ValueSuccess: Returns 1. Failure: Returns 0 if encountered any errors. RemarksThe file pattern cannot contain spaces!The attributes that can be modified with the function are + or -:"R" = READONLY"A" = ARCHIVE"S" = SYSTEM"H" = HIDDEN"N" = NORMAL"O" = OFFLINE"T" = TEMPORARY SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference.
jpm Posted July 23, 2005 Posted July 23, 2005 @gafrost, I tink the question is not related with copying but running the script from a CD. @rex can you post a script that reproduce your problem? Not sure what you are really doing.
Rex Posted July 23, 2005 Author Posted July 23, 2005 jpm said: @gafrost,I tink the question is not related with copying but running the script from a CD.@rexcan you post a script that reproduce your problem? Not sure what you are really doing.<{POST_SNAPBACK}>This is the code i use.filecopy(@ScriptDir & "\Files\File.exe", @TempDir , 1) runwait(@Tempdir & "\File.exe") filesetattrib(@TempDir & "\File.exe", "-R") FileDelete(@TempDir & "\File.exe") exitBut it's not deleting the file..How ever if i copy the script to the ramdrive and then run the script ones again it deletes the file.Therefore i thourght that the script woulden delete files, if run from a readonly location. (not the file to delete but the script )
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now