View Full Version : How to open folders?
Hi,
I'm trying to create a button to open a folder on my d:\
such as d:\program1
I can't seem to do it. I tried the explore function but that doesnt seem to be it.
Thanks
ianhull
02-21-2007, 07:34 PM
result = Dialog.FolderBrowse("Please select a folder:", "d:\program1");
Hi ianhull,
That code bring's up the following dialogue:
http://img252.imageshack.us/img252/8044/screenvh6.jpg
As apposed to the correct folder open infront of you. :eek:
fossil
02-22-2007, 03:10 AM
Try this :
File.Open("D:\\program1", "", SW_SHOWNORMAL);
el5ateer
02-22-2007, 03:59 AM
Check this one as well
File.Open("", "d:\\program1", SW_SHOWNORMAL);
Thanks guys. I tried fossil's first and it straight away worked. :D
Hi sorry, one last question.
how do I do it as <the default drive>:\
Depending on what you mean by "default drive" AMS has several Global Variables (or Build-in Variables) that are set dynamically at runtime and might be helpful to you.
Adapted from the help file:
Global variables (or "built-in variables") are variables whose values are automatically set when your AutoPlay application starts. They are used to represent common values that might differ between systems. These variables are all global which means you can use them anywhere in your project.
Tip: The built-in variables are listed along with all of the actions and constants when you press Ctrl+Space in the script editor. Since all of the built-in variables start with an underscore, if you type _ and then press Ctrl+Space, you'll be taken right to the first built-in variable in the list.
The following global variables are available in AutoPlay Media Studio:
_DesktopFolder
The path to the user's Desktop folder. On Windows NT/2000/XP/Vista, this is the path from the per-user profile.
_DesktopFolderCommon
The path to the user's Desktop folder. On Windows NT/2000/XP/Vista, this is the path from the All Users profile. On a non-Windows NT system, this will simply be the path to the user's Desktop folder (the same as _DesktopFolder).
_ProgramFilesFolder
The user's Program Files folder (typically, this is something like "C:\Program Files").
_SourceDrive
The drive that the AutoPlay application was run from (e.g. "C:" or "D:").
_SourceFolder
The full path to the folder that the AutoPlay application was run from (e.g. "C:\Downloads" or "D:").
_SystemFolder
The path to the user's Windows System folder (e.g. "C:\Windows\System" on non-NT systems, and "C:\Windows\System32" on NT based systems).
_TempFolder
The path to the user's Temp folder.
_WindowsFolder
The path to the user’s Windows folder (e.g. "C:\Windows").
Hi,
well i've changed the code to:
File.Open("_SourceDrive\Winamp", "", SW_SHOWNORMAL);
but it doesnt seem to open the folder. (yep, I've added the folders to source directory.
majik92
02-23-2007, 09:45 AM
Use this:
File.Open("_SourceDrive\\Winamp", "", SW_SHOWNORMAL);
_SourceDrive is a variable, so it does not need to be contained in the quotes. Try like this:
File.Open(_SourceDrive .. "\\Winamp", "", SW_SHOWNORMAL);
AudioSam
04-04-2007, 03:31 AM
File.Open(_ProgramFilesFolder.."\\Winamp\\Winamp.exe"); >>>don't know why the .exe is showing with space
If its the Winamp player you are wanting to open.
Hope this helps,
Get the Text App I posted and save this code in F directory
so you'll always have the code.
AudioSam
AudioSam
04-04-2007, 03:49 AM
File.ExploreFolder("C:\\Program Files\\Winamp", SW_SHOWNORMAL)
If its the Winamp folder yau are wanting to open.
ptrut
09-09-2009, 11:30 AM
Hi ianhull,
That code bring's up the following dialogue:
http://img252.imageshack.us/img252/8044/screenvh6.jpg
As apposed to the correct folder open infront of you. :eek:
I would like to have simaler but to delete chosen folder or folders
Thanks
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.