special-folders

Where to store Application Data in Windows 7 and Vista

ⅰ亾dé卋堺 提交于 2019-11-27 05:55:56
问题 My application needs to, like most, store data. The application was previously used on XP only where it would store the data in Program Files . Now that our customers are moving to Windows 7 I had to upgrade it so that it stored the data in a new folder. I opted for the ApplicationData folder as I thought I would be allowed access without needing UAC at all. Now on some Windows 7 machines this is fine, but on others access to the folder fails, presumably because of permissions, but when ran

Find system folder locations in Python

我是研究僧i 提交于 2019-11-27 05:47:41
问题 I am trying to find out the location of system folders with Python 3.1. For example "My Documents" = "C:\Documents and Settings\User\My Documents", "Program Files" = "C:\Program Files" etc etc. 回答1: I found a slightly different way of doing it. This way will give you the location of various system folders and uses real words instead of CLSIDs. import win32com.client objShell = win32com.client.Dispatch("WScript.Shell") allUserDocs = objShell.SpecialFolders("AllUsersDesktop") print allUserDocs

CommonAppData in vb6

痞子三分冷 提交于 2019-11-27 02:57:10
问题 Basically the same as this question, but for VB6 . A customer's application "AppName" has its configuration files stored in CommonAppData. Under Windows XP that is C:\Documents and Settings\All Users\Application Data\AppName Under Windows Vista that is C:\ProgramData\AppName How do I get the correct foldername with VB6? ? Additional notes , I prefer to use a API Call instead of adding a reference to the shell32.dll 回答1: Use late binding: Const ssfCOMMONAPPDATA = &H23 Dim strCommonAppData As

What determines the return value of Path.GetTempPath()?

萝らか妹 提交于 2019-11-27 01:26:23
问题 Currently, I use Path.GetTempPath() to figure out where to write my log files, but recently I came across a user's machine where the path returned was not what I expected. Usually, the returned path is C:\Documents and Settings\[userid]\Local Settings\Temp but in this case, it was C:\Temp This would not normally be a problem, but for some reason the user in question did not have access to write to C:\Temp I double checked the environment variables, and the USER environment variable was

How can I get the current user directory?

耗尽温柔 提交于 2019-11-27 00:16:06
Using this: Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) I get this output: "C:\\Documents and Settings\\[USER]\\Application Data" How can I get the root directory of all users? i.e.: "C:\\Documents and Settings\\[USER]\\" Anton Kolesov May be this will be a good solution: taking in account whether this is Vista/Win7 or XP and without using environment variables: string path = Directory.GetParent(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)).FullName; if ( Environment.OSVersion.Version.Major >= 6 ) { path = Directory.GetParent(path).ToString(); }

python - Finding the user's “Downloads” folder

被刻印的时光 ゝ 提交于 2019-11-26 23:08:23
问题 I already found this question that suggests to use os.path.expanduser(path) to get the user's home directory. I would like to achieve the same with the "Downloads" folder. I know that this is possible in C#, yet I'm new to Python and don't know if this is possible here too, preferable platform-independent (Windows, Ubuntu). I know that I just could do download_folder = os.path.expanduser("~")+"/Downloads/" , yet (at least in Windows) it is possible to change the Default download folder. 回答1:

How can I get the current user directory?

淺唱寂寞╮ 提交于 2019-11-26 09:19:39
问题 Using this: Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) I get this output: \"C:\\\\Documents and Settings\\\\[USER]\\\\Application Data\" How can I get the root directory of all users? i.e.: \"C:\\\\Documents and Settings\\\\[USER]\\\\\" 回答1: May be this will be a good solution: taking in account whether this is Vista/Win7 or XP and without using environment variables: string path = Directory.GetParent(Environment.GetFolderPath(Environment.SpecialFolder

Does Windows 7 restrict folder access as Vista does?

南笙酒味 提交于 2019-11-26 05:56:39
问题 I noticed that in my application, most compatibility problems were caused by \'access denied\' for some folders, such as: Application Data [C:\\ProgramData] Desktop [C:\\Users\\Public\\Desktop] Documents [C:\\Users\\Public\\Documents] Favorites [C:\\Users\\Public\\Favorites] Start Menu [C:\\ProgramData\\Microsoft\\Windows\\Start Menu] Templates [C:\\ProgramData\\Microsoft\\Windows\\Templates] Does Windows 7 have the same problem as Vista? With help from the members of Stack Overflow, I know