|
-
Sep 30th, 2000, 07:59 AM
#1
Thread Starter
Junior Member
how to manipulate the FAT in win95 so that a file is made hidden, and it becomes impossible to delete that file.
the option of setting the file attributes is very elementary.
the user should not be able to see that file, and should not be able to delete that file.
it must be possible to make the file visible through program, use it, and again make it hidden.
-
Sep 30th, 2000, 11:50 AM
#2
Not the best way but, to make it undeletable, you can use this line
Code:
Open "C:\Windows\Desktop\ttt.txt" For Input As #1
That way, it will always be open, thus, it will be harder for someone to delete.
If you really want to make it hidden and undeletable, I suggest you look into Assembly or C++ as VB is not the best language for direct disk access.
-
Sep 30th, 2000, 12:06 PM
#3
Hyperactive Member
I came across this problem myself a while back, and came up with the following solution.
1) Write the data to the file to be made hidden, and close it.
2) Create an MSDOS Batch file. ie
Code:
Open "hide.bat" for output as #1
3) Write the appropriate attrib line to the batch file. ie:
Code:
attrib +h c:\myfiles\text.txt
4) Shell the batch file from within VB. ie:
Code:
shell ("c:\myfiles\hide.bat")
You could always determine the location of the batch file by using the App.path object.
-
Sep 30th, 2000, 12:15 PM
#4
Monday Morning Lunatic
I think he means hiding the file, rather than setting its hidden attribute. One suggestion - find its FAT entry, and mark all its clusters as unusable. Then, when it is unlocked, mark them as read.
Although this is well out of VB's scope.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Sep 30th, 2000, 02:51 PM
#5
Fanatic Member
If you set the clusters unusable, then Scandisc will report it to the user.
-
Sep 30th, 2000, 05:05 PM
#6
Monday Morning Lunatic
I think there is a way to trick scandisk into not doing that...not sure what it is. (I know there is because some programs such as Magic Folders do that)
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Oct 1st, 2000, 01:25 AM
#7
Thread Starter
Junior Member
making a file hidden and undeletable
you are right in saying that there are some programs like magic folders which hide a directory and / or a file. i do not mean setting the hidden attribute of the file or directory.
similarly, the file / directory should not be deletable.
-
Oct 1st, 2000, 01:28 AM
#8
Thread Starter
Junior Member
hiding a file
the method of shelling it , or using a batch file is not desirable.
it is too naive, please suggest something else
-
Oct 1st, 2000, 09:25 AM
#9
How big is the file? If it's several Megs large then forget it, else try hiding the contents in the registry! (in a vague location or so).
That way you won't see a file, and wouldn't be able to delete it...
I think the "Magic Folders" also uses this technique, just as the "Control Panel"-folder doesn't exist (they are all *.cpl files in C:\windows).
Just my $0.02..
-
Oct 1st, 2000, 01:48 PM
#10
Monday Morning Lunatic
The control panel is a 'fake' folder. If you create a folder with a specific CLSID, as in "Control Panel.{xxx}", then it will load the In-Process server associated with that CLSID to provide the directory, as opposed to the normal file viewer. The Control Panel server simply loads all the .cpl files in your windows folder.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|