special-folders

Non-English special folder names in Vista/Win7

心不动则不痛 提交于 2019-12-12 01:35:47
问题 In non-english versions Windows Vista and Windows 7 the usual special folders (such as the "My documents" folder) have dual naming: For instance "My documents" can be accessed (in german systems) via C:\Users\Username\Documents But is displayed (in explorer and file choosing dialogs) as C:\Benutzer\Username\Eigene Dokumente In my (C#) application, I would like to display the second form but need to use the first one internally. So I'm looking for some function to convert e.g. the result of

How does one designate the root of a handheld device?

一曲冷凌霜 提交于 2019-12-11 16:39:07
问题 I need to recursively search a handheld device for any files anywhere on the device that follow a certain pattern (such as " Platypus .XML"). To pass the root of the device to my directory traversal method, do I pass "\" or something else? In Windows Explorer, the device is "J:\" - but I know that can't work, because it won't be mapped to J for everyone. The device's full name in Windows Explorer is something like: Duckbill (\\LEXINGTON\dev\Xmen\Miguel\Installs) (J:) ...but similarly, each

SaveFileDialog exception in my WPF app

不羁岁月 提交于 2019-12-10 17:21:57
问题 One of my customers is experiencing a crash in my WPF application when saving a file. My save file code is: var saveFileDialog = new SaveFileDialog { InitialDirectory = string.Concat(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), @"\MyApp"), FileName = "MyFile", OverwritePrompt = true, AddExtension = true }; if (saveFileDialog.ShowDialog() == true) { ... } And here is the exception they are getting: Value does not fall within the expected range. A System.ArgumentException

geting special folders with shell.application

为君一笑 提交于 2019-12-10 00:10:19
问题 I need in a script to return the path to the current user desktop. Now I know you can do it with WScript. var WshShell = WScript.CreateObject("WScript.Shell"); strDesktop = WshShell.SpecialFolders("Desktop"); But for my script this will not work as I cant use WScript. but I can use the shell.application object as below. dim objShell dim ssfWINDOWS dim objFolder ssfWINDOWS = 0 set objShell = CreateObject("shell.application") set objFolder = objshell.BrowseForFolder(0, "Example", 0, ssfWINDOWS)

Access the 'Application Data' folder when using Folder Redirection

江枫思渺然 提交于 2019-12-08 18:01:56
问题 We use Folder Redirection at my work, and I'm trying to simplify a script that runs when users log on to a Terminal Server. Is there a way, through SpecialFolders , to access the Application Data folder? I ask because if we have to move the location of the Folder Redirection (due to storage limitations), I'd rather not have to go through scripts and manually change things. Set objShell = WScript.CreateObject("WScript.Shell") desktop_location = objShell.SpecialFolders.Item("Desktop") quick

Windows Special and Known Folders from python (Start Menu, Downloads, …)

跟風遠走 提交于 2019-12-08 07:07:06
问题 What is the best method to determine the path of Windows special-folders and known-folders in python? I've uncovered a couple of popular methods for SpecialFolders, a.k.a CSIDL, but nothing straightforward yet for KNOWNFOLDERID. Backwards compatibility is maintained, so the CSIDL methods still work, but any special/known folders introduced since Windows XP are not enumerated there. Examples of the "new" unavailable ones include Downloads, Playlists, Program Files x64. Special Folders Find

get Common Documents folder in VBS

a 夏天 提交于 2019-12-08 03:20:54
问题 To my great chagrin, I must use VBS to write an InstallShield 2010 LE custom action. I have no VBS experience so I'm basically putting together code snippets that I find. I need to get a hold of the Common Documents folder (CSIDL_COMMON_DOCUMENTS). It's not defined in WScript.Shell.SpecialFolders (although All Users Desktop is). I found some example code that tries to link to a system DLL: Private Declare Function SHGetFolderPath Lib "shfolder.dll" _ Alias "SHGetFolderPathA" _ (ByVal

In Mono, how do I get the path to the Documents folder on a Mac (Snow Leopard)?

梦想与她 提交于 2019-12-07 14:55:48
问题 I'm writing a Mono application and would like to find the full path of the Documents folder - e.g. /Users/johnsmith/Documents/ . What's the best way to achieve this? 回答1: You can do this: string doc_path = Path.Combine (Environment.GetFolderPath (Environment.SpecialFolder.Personal), "Documents"); (Btw, for MonoTouch, It's just Environment.GetFolderPath (Environment.SpecialFolder.Personal) ). 来源: https://stackoverflow.com/questions/1933975/in-mono-how-do-i-get-the-path-to-the-documents-folder

Usage of SHGetSpecialFolderPath to retrieve an application folder that can be accessed also to non admin users, which CSIDL to choose?

走远了吗. 提交于 2019-12-07 00:45:47
问题 In my application I store on every machine some files in an application folder. A simplified version of the real case is this: ..\Project1\LoginHistory (login history file - common for all users) ..\Project1\Translations (localization files - common for all users) ..\Project1\FormSettings\User1\ (this contains an ini file per form for User1) ..\Project1\FormSettings\UserN\ (this contains an ini file per form for UserN) So you can see why I use this: to save some data that is specific to the

get Common Documents folder in VBS

不羁的心 提交于 2019-12-06 12:42:36
To my great chagrin, I must use VBS to write an InstallShield 2010 LE custom action. I have no VBS experience so I'm basically putting together code snippets that I find. I need to get a hold of the Common Documents folder (CSIDL_COMMON_DOCUMENTS). It's not defined in WScript.Shell.SpecialFolders (although All Users Desktop is). I found some example code that tries to link to a system DLL: Private Declare Function SHGetFolderPath Lib "shfolder.dll" _ Alias "SHGetFolderPathA" _ (ByVal hwndOwner As Long, _ ByVal nFolder As Long, _ ByVal hToken As Long, _ ByVal dwReserved As Long, _ ByVal