06-03-2003, 02:18 PM
06-03-2003, 02:55 PM
You mean readonly files?
You can remove the readonly attribute like this:
You can remove the readonly attribute like this:
Code:
'$INCLUDE:'QB.BI'
DEFINT A-Z
SUB DeleteReadOnly (FileName AS STRING)
DIM Regs AS RegTypeX
Regs.ax = &H4300
Regs.ds = -1
fl$ = FileName + CHR$(0)
Regs.dx = SADD(fl$)
INTERRUPTX &H21, Regs, Regs
Regs.cx = Regs.cx AND &HFFFE&
Regs.ax = &H4301
Regs.ds = -1
Regs.dx = SADD(fl$)
INTERRUPTX &H21, Regs, Regs
END SUB
06-03-2003, 06:18 PM
Or use SHELL to call DOS's ATTRIB...
06-04-2003, 04:28 AM
THX Neo
Antoni ?? What do you mean ?
I don't know these DOS's Attributes
Antoni ?? What do you mean ?
I don't know these DOS's Attributes
06-04-2003, 07:37 AM
In DOS commandline...
ATTRIB [+R|-R] [+A|-A] [+S|-S] [+H|-H][[unit:][path]fliename][/S]
...where...
+R sets READONLY attribute, -R removes it
+A sets ARCHIVE attribute (read/write flag), -A removes it
+S sets SYSTEM attribute, -S removes it
+H sets HIDDEN attribute, -H removes it
...and...
/S to process files in the current directory/folder and in all its subdirectories.
So, in your case:
SHELL "ATTRIB -R filename.ext"
...and that's all.
ATTRIB [+R|-R] [+A|-A] [+S|-S] [+H|-H][[unit:][path]fliename][/S]
...where...
+R sets READONLY attribute, -R removes it
+A sets ARCHIVE attribute (read/write flag), -A removes it
+S sets SYSTEM attribute, -S removes it
+H sets HIDDEN attribute, -H removes it
...and...
/S to process files in the current directory/folder and in all its subdirectories.
So, in your case:
SHELL "ATTRIB -R filename.ext"
...and that's all.
06-04-2003, 01:06 PM
I prefer my code, else I would have a black screen coming through my program at every SHELL call.