Two problems

Klaus Major klaus at major-k.de
Tue Nov 18 06:08:44 EST 2008


Hi tareq

> Hi,
>
> I use windows xp. I need the solution of the following
> problems. Pls, solve the problems in detail and make
> me greatful.
>
> 1. In "autorun.inf" file, there may be written
> "open=autorun.exe" or "open=myFile.txt" or
> "Open=Readme.pdf" etc. I need to verify what filename
> is written after "open=" and to delete that file. What
> will be the script? Is it possible with lineoffset
> function?

Yes :-)

Given you have the file "autorun.inf" already in a variable named  
my_autorun:
...
put lineoffset("open=",my_autorun) into tLine
if tLine <> 0 then
    put line tLine of my_autorun into my_line
    replace "open=" with "" in my_line
    ## Now my_line contains the desired filename
   ## and you can do whatever you want with it...
end if
...

> 2. How to delete only the hidden files from a
> directory?

If all the hidden files have DOT as the first char in the filename  
then you can do this:
...
## Get the directorys content:
set the directory to "You folder here"
put the files into tFiles

## Filter only files that start with a dot:
filter tFiles with ".*"

## Now tFiles holds all hidden files, do whatever you think you have  
to ;-)
...

> pls, help me...

Sure we do, but please a tad less drama the next time :-D


Best

Klaus Major
klaus at major-k.de
http://www.major-k.de





More information about the use-livecode mailing list