Sunday 15 January 2012

c# - Programmatically-created subfolder not visible in Windows Explorer -


I am trying to add a subdirectory to an existing path.

Win-64 64, Intel SSD

Administrator was logged in to the company's domain as a user, but not as "Administrator".

Visual Studio 2008, launched normally ("did not run as administrator")

Here MyApp (WinForms, Debug, x86):

  [STAThread] Private static zero main (string [] args) {string p = @ "C: \ ProgramData \ MyCompany \ MyApp"; Directory.CreateDirectory (P); String F = "a.txt"; String full path = path. Combine (P, F); File. Write all text (absolute path, string. Empty); Directory.Delete (P);   

Expected, the last line throws IOException: "The directory is not empty" This should mean that the sub-date and file has been created.

Problem: Windows Explorer does not show MyApp subsection (even after refreshing, type path in the address bar, stop / restart or reboot).

C: \ ProgramData \ MyCompany \ was made by another app's installer; Windows Explorer says its current owner is a system.

Using the same IDE to create a console app (debug, x86), the above lines were copied and ran; Windows Explorer was pleased to show me the digital test app and file inside.

If I do one of the following for MyApp, then the problem gets resolved (i.e. Windows Explorer shows me the "MyApp" subtitle and file inside < / P>

Li>

of "MyApp" Use any name other than (but I need to use MyApp for heritage reasons)

What can be done with it?

"Check if you find your directory And can enter a file elsewhere in C: \ user \ JimC \ AppData (Folder Virtualization) related: "

Then what I did after reading his advice:

I removed virutalized directory from C: \ users and It is not sure how this is made in the first place, but it appears, when it exists, attempts to make that directory where I expected that instead of being virtualized one gets .

Thanks again DTB

No comments:

Post a Comment