Why is a duplicate folder being created in users/public/public documents on Windows 7? - windows-7

A java application is using the %PUBLIC% environment variable to get the path to "c:\users\public". It then appends that with "public documents" and tries to read a file from the folder and fails (it previously read and wrote the file successfully). The application shows no data and when it tries to write to the "c:\users\public\public documents" folder a duplicate "c:\users\public\public documents" folder is created with the new version of the content. You can still get to the original content using windows explorer and see it all there, but now there are two "public documents" folders.
Previously it was reading and writing to the public documents folder without any problem. This is happening with every account on the system, but it is still working just fine on every other PC the software is installed on.

What Windows Explorer doesn't make evident is that the real folder is not actually called "Public Documents", but is actually called "Documents". The "Public Documents" is simply a display name, but as far as NTFS is concerned you can have both a "Documents" and "Public Documents" folder with no ill effects.
Use %PUBLIC%\Documents to refer to the actual folder you're looking for.

Related

Power Automate - Can't navigate to folder or obtain folder id

this is a general question about Power Automate and OneDrive that I've seen no solution to.
I'm trying to create a flow "Copy files from a folder in OneDrive (Business) to an FTP server". The trigger is "When a filed is created" in a OneDrive directory. When I attempt to navigate to the folder I just see ROOT, then "No Items".
I also can't figure out how to obtain the unique identifier of the folder.
I was able to get the ID of my folders with this short Instant flow.
It'll output a JSON response with the ID, Name, Path, etc for all your folders in the Root of OneDrive. There is also a "List files in folder" block that you can use to get subfolders of folders.
I was able to copy the ID string from the JSON response and paste it into the "When a file is create" OneDrive trigger and have it go off successfully.
The issue was I was attempting to do this using OneDrive(Business) when I should have used Sharepoint based on my organization's license

What is the path of "my computer" folder on windows?

I am working on a C++ windowsform project, using visual Studio IDE.
I use CFileDialog class to ask the user to select a file to open.
It display an usual open file selection windows.
I would like the default folder displayed to be the same as the one accessed when clicked on "My computer", where the harddrives, USB drives, dvd drives etc. are displayed.
I can define default folder by writting its path tolpstrInitialDir member, but I don't find the path for such a folder. I tried "\", "explorer.exe", "", none of them gave me the expected result.
The application will be used by several users, so the solution must not include the user name in the path. i.e "C:\Documents and Settings[user]\Desktop\My Computer" may work but is not correct for my application.
Does anyone know of to define the "root" path of windows (i.e the root of C:\) ?
I searched on SO and internet but maybe I have used wrong keywords because I couldn't find appropriate content.
My Computer is a virtual shell folder that doesn't correspond to any file system directory. There's no file system path that would correspond to that location.
Fortunately, file dialogs do speak "shellese", so you can use the CLSID (not to be confused with the GUID KNOWNFOLDERID or the CSIDL) of the shell folder. Sample in C# Winforms, but really, the only important part is the ::CLSID):
var ofd = new OpenFileDialog();
ofd.InitialDirectory = "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}";
ofd.ShowDialog();
Disclaimer: I couldn't find any relevant documentation for the virtual folder CLSID, or this behaviour of the File dialog. So this is most likely not contractual, and could possibly change in future versions of Windows.
In the explorer, in the search bar copy the address of
This PC
and then select the text
This PC
and paste. Normally we get the
Ce PC ":: {CLSID}"
and then just copy
:: {CLSID}
and paste it wherever we want.
Path should be: C:\Users\UserName\Desktop\Computer.lnk

Reason why folder associated with saved webpage gets deleted when we delete saved page

I have saved a complete webpage and there is also one folder saved with resources but when I delete webpage or move saved webpage to other directory then the folder associated with it also gets deleted or moved. So what is the code written behind it. Because I want to do same with my webpage and folder.
Thanks in advance for you kind help.
This "association" between the HTML file and its resources folder is a behaviour implemented by the Windows operating system.
It has nothing to due with a webpage in particular, with its HTML, JavaScript, or even with a particular browser.
Windows 2000 provides a simple way to connect a primary HTML file to its group of associated files. If Connected Files is enabled, when you perform any of the commands [Copy, Cut, Paste, Move, Delete, Send To] on a file or folder of associated files, the same command is performed on all connected files.
Even though the official page mentions "Windows 2000", the same behaviour is implemented in Windows XP and many (if not all) later versions of Windows.
See these pages:
Removing file / folder link after using “Save As…” then “Web Page, complete”
Operations on an HTML file or folder apply to similarly named folder or HTML file (from Microsoft support)

How do I link directly to an alias through afp?

I'm working on an intranet web application with a file sharing server set up using AFP.
My goal is to create a link on the page that will open up Finder to a specific folder on the share network, but it has to go through an alias. I think it'd be easier to explain with an example.
For this share, there is a folder called Objects that contains a bunch of folders with unpredictable names, and a folder called Alias that contains a bunch of aliases to folders in Objects. So a link to afp://server/share/Alias/obj1 should open the folder at afp://server/share/Objects/unpredictableName, where obj1 is an alias pointing to unpredicableName.
On OSX 10.8 this works as expected, however on 10.9 and later that link opens the Finder at the Alias folder, instead of actually going into unpredictableName. What changed, and is there any way to restore the previous behavior? Thanks.

Does app data hide files or create a virtual folder?

My application creates a bunch of temporary .class files and I had been storing these files in my local application directory but I recently started storing these in appData. Everything functions fine and I even have a part of my application that creates an applet and needs to copy these .class files to make the applet and the applet works fine but for some reason the .class files are not showing up in AppData. I searched for the .class files (with everything enables hidden files et al) and the only place they show up are in the applet I created. This seems impossible that this could be happening unless somehow things stored in AppData are hidden or there is some sort of virtual folder at work here. I have tried this on both XP and windows seven. Any ideas?
Have your application spit out (debug print, message box, however) the absolute path to where it is writing the files.
Windows XP search function is rather crippled by default and it will not find files in many locations including folders that it considers temporary, hidden, system or non indexed, as well as several specific folders in the user profile.
A quick way to do a 'useful' search is from the command line from within your profile directory:
dir /s /b | find ".class"
No virtual folder or hiding going on that I know of. Have you verified the AppData location on your machine? WindowsKey-R (or Start -> Run) then type %appdata% and see what comes up.

Resources