forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


hidden directory

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Sat Feb 22, 2003 8:03 am    Post subject: hidden directory Reply with quote

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
View user's profile Send private message Visit poster's website MSN Messenger
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Sat Feb 22, 2003 8:14 am    Post subject: Reply with quote

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 Smile

_________________
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
View user's profile Send private message Send e-mail
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Sat Feb 22, 2003 8:22 am    Post subject: Reply with quote

OR... ya might use the DOS attrib command if ME has it... Wink
_________________
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
View user's profile Send private message Send e-mail
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Sat Feb 22, 2003 8:28 am    Post subject: Reply with quote

XP has got it...
Back to top
View user's profile Send private message
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Sat Feb 22, 2003 8:39 am    Post subject: Reply with quote

thanks for that, guys Very Happy

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
View user's profile Send private message Visit poster's website MSN Messenger
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Sat Feb 22, 2003 8:40 am    Post subject: Reply with quote

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).... Wink
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 Smile

_________________
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
View user's profile Send private message Send e-mail
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Sat Feb 22, 2003 8:44 am    Post subject: Reply with quote

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)... Confused

Cheers, Mac Smile

_________________
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
View user's profile Send private message Send e-mail
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Sat Feb 22, 2003 8:48 am    Post subject: Reply with quote

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". Wink

Cheers, Mac Smile

_________________
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
View user's profile Send private message Send e-mail
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Sat Feb 22, 2003 8:53 am    Post subject: Reply with quote

thanks mac, i'll give your code a go

shame that it has to be so looonnngggg winded to do a simple thing Sad

Serge

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Sat Feb 22, 2003 8:55 am    Post subject: Reply with quote

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. Wink
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 Smile

_________________
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
View user's profile Send private message Send e-mail
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Tue Mar 04, 2003 10:26 am    Post subject: Reply with quote

to save me time, i used your code above mac (with the appropriate changes) and it works like a charm Very Happy

thanks for your help Smile Smile Smile

Serge

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group