Solved

VB6 Password on folder.

Posted on 2003-11-25
23
507 Views
Last Modified: 2010-05-01
Hi,

Can I set a password on a folder that I will use my program to open this folder only after inputing the password?



Thanks,
Angel
0
Comment
Question by:2Angel
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 12
  • 11
23 Comments
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 9819723
i think not, at least if you don't use a third party software like Folder Guard.
but that is only half of the solution (setting a pwd for a folder)
0
 
LVL 2

Author Comment

by:2Angel
ID: 9825372
Richie, like always - thank you for your quick replay.

If I will create a folder using a dos prompt and I will call this folder ("directory") as a graphic symbol (you know, using the Alt and keying the number, let say, Alt159....) It will not be accessible in MsWindows Explorer (it's good enough for me) - so the question is: can I access this folder using my VB6 program?


Thanks again
Angel
0
 
LVL 16

Accepted Solution

by:
Richie_Simonetti earned 100 total points
ID: 9825452
humm, if it is not visible with windows explorer, why it could be seen with VB functions that uses the same calls?
On the other hand, if you know that "hidden" name, try to put some files on it and do a simple test:


dim sfile as string

sfile=dir$(hiddenfolderpath_and_name & "\*.*",vbarchive)

do while sfile<>""
     debug.print sfile
sfile=dir$()
loop
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 2

Author Comment

by:2Angel
ID: 9825611
I don't get it - the name of the foder is _ no mater what I called it - so, who can I key in program the "hiddenfolderpath_and_name"?


tks
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 9825712
I don't get it either!
in other words :

dim sfile as string

sfile=dir$("c:\your_graphic_symbol_goes_here" & "\*.*",vbarchive)

do while sfile<>""
     debug.print sfile
sfile=dir$()
loop
0
 
LVL 2

Author Comment

by:2Angel
ID: 9825917
Dear Richie, my meaning was that I can't enter a graphic symbol to my VB editor.....
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 9825963
well, what is the symbol?, i tried with your suggestion (alt159) and it works.
Anyway,
could you try with:


sfile=dir$("c:\" & Chr$(159)  & "\*.*",vbarchive)
?
or i misunderstood again?

0
 
LVL 2

Author Comment

by:2Angel
ID: 9826048
ooooopppppppssssssssss
so stopid of me..................

I'm sorry and tks alot!!!!


Angel

p.s. - can I set a password chck-up before this action (before accessing this folder show a window to enter the password, if its o.k. then access...., if not then msgbox.......)?

tks
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 9826078
Why not?
0
 
LVL 2

Author Comment

by:2Angel
ID: 9826157
o.k. - I will ask a new question.....



Richie,
Thank you for lighting my eyes :-)
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 9826244
Glad to help. Hope i didn't blind them with so many light
;)

PS: it would nice to know which kind of program are you trying to do.
0
 
LVL 2

Author Comment

by:2Angel
ID: 9826296
it's a simpel program to save my files on a shered computer and to retrive them automaticly.....
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 9826427
So creating aform to enter password should be simple to achieve.
0
 
LVL 2

Author Comment

by:2Angel
ID: 9826446
I am just an amateur..........
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 9826457
Ah, that's another matter, so, do you need help with that form?
0
 
LVL 2

Author Comment

by:2Angel
ID: 9830501
I'll be glad.............  :-)
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 9831422
Well, first we need to know how would you allow user to see the files, where would you display them as user can pick up them?
0
 
LVL 2

Author Comment

by:2Angel
ID: 9831635
I thought to create a button for "Hide" and a button for "Show".
The button "Hide" will move all file from DocFile to Doc&chr$(159) and the button "Show" will move the back after inserting a correct password that I will but in advance.
There only one user (I am... )


Thank you for your help.

Angel

p.s. - my solution above, about creating the a folder with Alt159 working good on Windows95/me but in Windows XP this folder is accessible - do you have any solution for that?
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 9831670
it is accesible in W2K too.
0
 
LVL 2

Author Comment

by:2Angel
ID: 9831683
int's not good........
0
 
LVL 2

Author Comment

by:2Angel
ID: 9831687
it's not good......
0
 
LVL 2

Author Comment

by:2Angel
ID: 9831736
can I simple hide the folder? (I don't need some thing "stong")
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 9831756
You can hide the folder but if you set window explorer to show hidden folder/files it could be visible.
0

Featured Post

Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question