How to browse for file (Win7/64bits)
I need to quickly write a simple GUI over a command line application. Two steps are required: Specify an input file path, Specify an output file path (non existing) I found out a previous post, however trying to get the above (1) to work seems like an insane task. Indeed BrowseForFolder seems to only work in some weird cases, you can use BIF_BROWSEINCLUDEFILES for only *.pdf and/or *.txt (trial and errors). I can get an error if I select a *.dll and/or a *.jpg (don't ask). So instead, I gave up this approach and followed another one, in this case (objIE.Document.all.FileSelect), only the name of the selected file is returned the path seems to be always set to "c:/fakepath" for some reason. So again I am missing the full path to be able to pass that to the command line app. Is there any sane way (<10 lines of codes) to get (1) and (2) working on Win7/64bits (VBS, HTA...)?
Don't know if people are still interested in the BrowseForFolder file selection issue, but here's what I've found. I had the same issue selecting files with BrowseForFolder using &H4000 / BIF_BROWSEINCLUDEFILES. I could get a return with .docx but not .doc files and as you say .pdf files. For me .txt wouldn't return anything, as didn't WMI Backup .rec files that I needed for a script I'm writing, resulting in this error information:- Error: Unspecified error Code: 80004005 Source: (null) After looking at other solutions I came back to this one as my preferred choice, plus it was doing my head in that it didn't want to work. So at the bitter end it seems to be this easy. To get my .rec files recognized I add this to the registry:- [HKEY_CLASSES_ROOT\.rec] #="WMI.Backup" [HKEY_CLASSES_ROOT\WMI.Backup] #="WMI Backup" "BrowseInPlace"="1" To get .txt files recognized I add this to the registry:- [HKEY_CLASSES_ROOT\txtfile] "BrowseInPlace"="1" So "BrowseInPlace"="1" seems to be the nugget. Seems so unbelievably easy that I'm sure this solution is out there somewhere but I never came across it so thought I'd put it online. I would be interested to find that it works for others as I fear that this issue may of sent me mad, still can't believe it seems to work. Hope this helps.
Here are 3 different ways to do what you want: http://www.robvanderwoude.com/vbstech_ui_fileopen.php
what is the base relocation table in the PE file format?
How can I run this VBS script from a shared network drive, from command line on multiple computers?
Jenkins on Windows 2008 R2 SSH
Open file with Batch file
Unable to install heroku core plugins
Change directory to startup folder
Batch file that checks connectivity and restarts a program when not having internet connection
What are methods used to identify the system call and pass function tasks to the operating system?
HP Data Protector - very long backup duration
system(“Child.pl $argument”) does not pass argument to Child.pl [duplicate]
Open Media Vault Rsync syntax
how to get recent event recorded in event logs(eg: logged before about 10 seconds) in Windows using C++?
Abnormal consumption of RAM Windows Server 2008 R2
Windows .gitconfig setting for GitExtensions editor
Using an absolute path when setting the webdriver for Internet Explorer in Protractor on Windows
Initial protocol between Webcam and driver