By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,144 Members | 872 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,144 IT Pros & Developers. It's quick & easy.

How to read the "view hidden/system files" Folder Options from within C#

P: n/a
Hi,

Can someone tell me where to look to enable me to read "Folder Options" user
settings for hidden/system files from within C#/VB.Net/Any other .NET
language. I'm pretty sure it must be part of the framework, but I'm buggered
if I can figure out which part. I've tried googling for it, but to no avail.

Any ideas?

Thanks

Greg
Nov 15 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
These values are actually stored in the registry. Here is a link explaining
the keys and values.

http://www.winguides.com/registry/display.php/961/

--
Jared Parsons [MSFT]
ja******@online.microsoft.com
This posting is provided "AS IS" with no warranties, and confers no rights.
OR if you wish to include a script sample in your post please add "Use of
included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm"
"Greg Bell" <no***@noneofyourbusiness.com> wrote in message
news:Or****************@TK2MSFTNGP09.phx.gbl...
Hi,

Can someone tell me where to look to enable me to read "Folder Options" user settings for hidden/system files from within C#/VB.Net/Any other .NET
language. I'm pretty sure it must be part of the framework, but I'm buggered if I can figure out which part. I've tried googling for it, but to no avail.
Any ideas?

Thanks

Greg

Nov 15 '05 #2

P: n/a
Hi Jared,

Thanks for that.

Much appreciated.

Regards

Greg

"Jared Parsons [MSFT]" <ja******@online.microsoft.com> wrote in message
news:e9****************@TK2MSFTNGP11.phx.gbl...
These values are actually stored in the registry. Here is a link explaining the keys and values.

http://www.winguides.com/registry/display.php/961/

--
Jared Parsons [MSFT]
ja******@online.microsoft.com
This posting is provided "AS IS" with no warranties, and confers no rights. OR if you wish to include a script sample in your post please add "Use of
included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm"
"Greg Bell" <no***@noneofyourbusiness.com> wrote in message
news:Or****************@TK2MSFTNGP09.phx.gbl...
Hi,

Can someone tell me where to look to enable me to read "Folder Options"

user
settings for hidden/system files from within C#/VB.Net/Any other .NET
language. I'm pretty sure it must be part of the framework, but I'm

buggered
if I can figure out which part. I've tried googling for it, but to no

avail.

Any ideas?

Thanks

Greg


Nov 15 '05 #3

P: n/a
Hi Jared and anyone else who might be watching this thread,

After some quick research, with help from your pointer, I have determined
that it's not ShowSuperHidden that controls the visibility of hidden or
system files. The field/item that needs to be read is "Hidden".

BTW: Code to access and read the value in C#.

//Determines if the current user has set Show Hidden/System files on or off.
private bool HiddenFilesAreInvisible()
{
bool blnHideFiles = true;
RegistryKey rkyCurrentUser = Registry.CurrentUser;
rkyCurrentUser =
rkyCurrentUser.OpenSubKey(@"Software\Microsoft\Win dows\CurrentVersion\Explor
er\Advanced",false); //Open Read Only
string strShowHidden = rkyCurrentUser.GetValue("Hidden").ToString();
//According to my research when the "Hidden" field is set to 1 the files
are visible, when its' value is 2 they are invisible.
if(strShowHidden=="1")
blnHideFiles = false;
rkyCurrentUser.Close();
return blnHideFiles;
}

Thanks

Regards

Greg

"Jared Parsons [MSFT]" <ja******@online.microsoft.com> wrote in message
news:e9****************@TK2MSFTNGP11.phx.gbl...
These values are actually stored in the registry. Here is a link explaining the keys and values.

http://www.winguides.com/registry/display.php/961/

--
Jared Parsons [MSFT]
ja******@online.microsoft.com
This posting is provided "AS IS" with no warranties, and confers no rights. OR if you wish to include a script sample in your post please add "Use of
included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm"
"Greg Bell" <no***@noneofyourbusiness.com> wrote in message
news:Or****************@TK2MSFTNGP09.phx.gbl...
Hi,

Can someone tell me where to look to enable me to read "Folder Options"

user
settings for hidden/system files from within C#/VB.Net/Any other .NET
language. I'm pretty sure it must be part of the framework, but I'm

buggered
if I can figure out which part. I've tried googling for it, but to no

avail.

Any ideas?

Thanks

Greg


Nov 15 '05 #4

P: n/a
Hi again,

Update as to where I found the bits I was looking for on editing the
registry.

http://www.csharphelp.com/archives2/archive430.html

Regards

Greg

"Jared Parsons [MSFT]" <ja******@online.microsoft.com> wrote in message
news:e9****************@TK2MSFTNGP11.phx.gbl...
These values are actually stored in the registry. Here is a link explaining the keys and values.

http://www.winguides.com/registry/display.php/961/

--
Jared Parsons [MSFT]
ja******@online.microsoft.com
This posting is provided "AS IS" with no warranties, and confers no rights. OR if you wish to include a script sample in your post please add "Use of
included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm"
"Greg Bell" <no***@noneofyourbusiness.com> wrote in message
news:Or****************@TK2MSFTNGP09.phx.gbl...
Hi,

Can someone tell me where to look to enable me to read "Folder Options"

user
settings for hidden/system files from within C#/VB.Net/Any other .NET
language. I'm pretty sure it must be part of the framework, but I'm

buggered
if I can figure out which part. I've tried googling for it, but to no

avail.

Any ideas?

Thanks

Greg


Nov 15 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.