Open a folder on desktop

Archives Forums/BlitzPlus Programming/Open a folder on desktop

Timjo(Posted 2011) [#1]
How do I open a folder from within a program? By this I mean in the same way that a web browser has a button to click to 'Open Download Folder' and this folder will then open on the desktop.
I know I can run 'explorer.exe' with the EXECFILE command - but I'm not sure how to get it to open a specified folder. Would this be a Commandline issue?
Any help welcome..Thanks.

Matty(Posted 2011) [#2]
Have you used the "RequestDir" and "RequestFile" commands in blitzplus?

xlsior(Posted 2011) [#3]
Explorer "c:\folder" should work.(put double quotes around the folder name to account for spaces in the name)

Timjo(Posted 2011) [#4]
Requestdir will work for me - Thanks (I missed that command somehow)

xlsior - I'm not sure how I would pass "C:\folder" when running explorer.exe with execfile. Or is there another way to do this that I'm unaware of (this is very likely!)

Anyway - thanks for the responses both.

Stamm(Posted 2011) [#5]
something like execfile("explorer folder"); if the path contains spaces do
execfile("explorer "+chr(34)+"path"+chr(34))

edit: you could also do execfile(chr(34)+"path"+chr(34)), but then the path has to end with a slash or backslash, depending on the format you are using. Execfile basically does the same as Win-R and typing in whatever you pass to Execfile.

Last edited show_time('2011-11-11 12:16:27')

Timjo(Posted 2011) [#6]
I'll try that out - many thanks to all for the help.