| View previous topic :: View next topic |
| Author |
Message |
Serge Professional Member


Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Sat Feb 22, 2003 8:03 am Post subject: hidden directory |
|
|
i need to be able to test as to whether a folder is hidden or not, and i can't get it to work using:
| Code: |
if @file(c:\whatever,dh)
blah blah...
end
|
the following does not work either:
| Code: |
if @file(c:\whatever,h)
blah blah...
end
|
any ideas?
i'm running vds 4.5 under me
thanks in advance
Serge _________________
|
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Sat Feb 22, 2003 8:14 am Post subject: |
|
|
Try something like this:
| Code: |
LIST CREATE, 1
LIST FILELIST, 1, c:\whatever, DH
if @item(1)
INFO Folder found!@tab()
else
WARN Folder NOT found...@tab()
end
|
Cheers, Mac  _________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
 |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Sat Feb 22, 2003 8:22 am Post subject: |
|
|
OR... ya might use the DOS attrib command if ME has it...  _________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
 |
|
| Back to top |
|
 |
Skit3000 Admin Team

Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
Posted: Sat Feb 22, 2003 8:28 am Post subject: |
|
|
| XP has got it... |
|
| Back to top |
|
 |
Serge Professional Member


Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Sat Feb 22, 2003 8:39 am Post subject: |
|
|
thanks for that, guys
i will check out your code mac
i had thought of the old dos attrib but was wanting to avoid going down that road
any reason why the dh switch doesn't work? seems odd to me...
i'm surprised skit that xp has the attrib file
Serge _________________
Last edited by Serge on Sat Feb 22, 2003 8:47 am; edited 1 time in total |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Sat Feb 22, 2003 8:40 am Post subject: |
|
|
OK - if the DOS command module is named something other
than "command", change this to whatever it uses.
Also change "c:\whatever" to the file or folder name to check
(might need to use @shortname() if the name has spaces)....
| Code: |
RUNZ command /c attrib c:\whatever > c:\test.txt, WAIT
LIST CREATE, 1
LIST LOADFILE, 1, c:\test.txt
if @greater(@pos("H", @substr(@item(1), 1, 13)), 0)
INFO Is hidden...@tab()
else
INFO Is NOT hidden...@tab()
end
FILE DELETE, c:\test.txt
|
Cheers, Mac  _________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
 |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Sat Feb 22, 2003 8:44 am Post subject: |
|
|
OOPS - ya beat me posting Serge....
The LIST FILELIST command may not work either, because
the attributes are cumulative - it prolly shows BOTH those
that are hidden AND folders (dirs)...
Cheers, Mac  _________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
 |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Sat Feb 22, 2003 8:48 am Post subject: |
|
|
One more thing on DOS attrib - ya should check the @item()
in the list - if the file/folder doesn't exist, the "H" won't be there.
Instead, @item(1) will be "File Not Found".
Cheers, Mac  _________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
 |
|
| Back to top |
|
 |
Serge Professional Member


Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Sat Feb 22, 2003 8:53 am Post subject: |
|
|
thanks mac, i'll give your code a go
shame that it has to be so looonnngggg winded to do a simple thing
Serge _________________
|
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Sat Feb 22, 2003 8:55 am Post subject: |
|
|
OK - here's an attrib example that checks for the name in LIST 1.
Give it a few seconds if the file/folder doesn't exist.
| Code: |
%%name = @shortname(c:\whatever)
RUNZ command /c attrib %%name > c:\test.txt, WAIT
LIST CREATE, 1
LIST LOADFILE, 1, c:\test.txt
FILE DELETE, c:\test.txt
if @greater(@pos(%%name, @item(1)), 0)
INFO %%name found...@tab()
else
INFO File/folder NOT found...@tab()
EXIT
end
if @greater(@pos("H", @substr(@item(1), 1, 13)), 0)
INFO %%name is hidden...@tab()
else
INFO %%name is NOT hidden...@tab()
end
|
Cheers, Mac  _________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
 |
|
| Back to top |
|
 |
Serge Professional Member


Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Tue Mar 04, 2003 10:26 am Post subject: |
|
|
to save me time, i used your code above mac (with the appropriate changes) and it works like a charm
thanks for your help
Serge _________________
|
|
| Back to top |
|
 |
|