unhide hidden files

M

Mike

I have a canned/ validated program that creates hidden files on a XP
box. I have another program written by a vendor that comes around and
archives those files, all except for the hidden files.

I need a way to not allow hidden files to be created, at the OS,
because I don't think the program can change. This would have to be
tested

or

I need a good script or program can that go around and unhide all
hidden files in a certaing directory and sub directories.

What would be the best approach? I post here because you all may be
able to solve it using the first approach.

Thanks
Mike
 
P

Pegasus \(MVP\)

Mike said:
I have a canned/ validated program that creates hidden files on a XP
box. I have another program written by a vendor that comes around and
archives those files, all except for the hidden files.

I need a way to not allow hidden files to be created, at the OS,
because I don't think the program can change. This would have to be
tested

or

I need a good script or program can that go around and unhide all
hidden files in a certaing directory and sub directories.

What would be the best approach? I post here because you all may be
able to solve it using the first approach.

Thanks
Mike

You can't prevent Windows from creating hidden files. However,
you can unhide them like so:
- Click Start / Run / cmd {OK}
- Type this command:
attrib -h /s /d "c:\program files\My Application"{Enter}
 
M

mayayana

It's easy to use a script, though it might be
more tricky if you need it to run on a schedule
or have it otherwise automated.

I use something like the following to fix the
bug whereby files coming of of a CD do not
have the read-only attribute removed. I just leave
a copy on my Desktop and drop folders onto it.

Copy the text below (between the ----- lines)
into Notepad and save as unhide.vbs. Then just drop
any folder onto it. All files in all subfolders will have
their attributes cleared.

To clear ALL attributes, remove the apostrophe
from the front of this line:

oFil.Attributes = 0 '--all

and put apostrophes in front of these lines:

iAt = oFil.Attributes '--hidden
If (iAt And 2) Then iAt = iAt - 2 '--hidden
oFil.Attributes = iAt '--hidden

To remove only the hidden attribute, do the opposite,
putting an apostrophe only in front of:

oFil.Attributes = 0 '--all

--------------------------


Dim FSO, Arg
On Error Resume Next
Arg = WScript.Arguments(0)
Set FSO = CreateObject("Scripting.FileSystemObject")
If FSO.FolderExists(Arg) = False Then DropIt
UnHide Arg
DropIt

Sub UnHide(FPath)
Dim oFol, oFols, oFol1, oFils, oFil, iAt
On Error Resume Next
Set oFol = FSO.GetFolder(FPath)
Set oFils = oFol.Files
For Each oFil in oFils
'-- To remove all attributes - read-only, hidden,
'-- system, etc. - use this line:
' oFil.Attributes = 0 '--all

'-- To only unhide files, use these 3 lines:
iAt = oFil.Attributes '--hidden
If (iAt And 2) Then iAt = iAt - 2 '--hidden
oFil.Attributes = iAt '--hidden
Next
Set oFils = Nothing

Set oFols = oFol.SubFolders
For Each oFol1 in oFols
Unhide oFol1.Path
Next
Set oFols = Nothing
Set oFol = Nothing
End Sub


Sub DropIt()
Set FSO = Nothing
WScript.Quit
End Sub
 
P

Plato

Mike said:
I have a canned/ validated program that creates hidden files on a XP
box. I have another program written by a vendor that comes around and
archives those files, all except for the hidden files.

It's best NOT to use such an app.
 
M

Mike

It's best NOT to use such an app.

--http://www.bootdisk.com/

No choice. It's our ECM system. We are trying to get the vendor to
make some changes but haven't heard yet. I am now trying to find a
suitable workaround. A script to unhide seems like the best option
but I still do not hava a warm fuzzy over it. I am in a validated
environment so any such script has to be documented and then isn't
easily tweaked.
 
M

mayayana

No choice. It's our ECM system. We are trying to get the vendor to
make some changes but haven't heard yet.
If the vendor software cannot see hidden files (but
doesn't mean to leave them out) they're most likely using
the Shell Object, or the IShellFolder interface, or some
related method to enumerate the files. They need to know
that those methods are quirky and undependable, not
intended for file system access.

That probably doesn't help you much, but it may set
off a lightbulb in their head if they, themselves, can't
figure out why hidden files are not being processed.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top