Wanted: Sample scripts to cannibalize

Page 4 of 6 FirstFirst ... 23456 LastLast

  1. Posts : 756
    Windows 10/11
       #31

    @Try3 Updated version is now available using the same link. The built-in help has been updated to reflect the changes. Here is an example with a dialog title:

    Code:
    FileDialog.exe Open C:\Users "*.ini|*.ini" "Select an INI file" false
    If the dialog title is is the same as one of the special folders names (e.g. "Documents"), prefix it with a tilde (this should be a very rare situation):
    Code:
    FileDialog.exe Open "*.doc|*.doc" ~Documents Documents false
    I haven't had time yet to look at retrieving the value from the console, but that's on my To Do.
    Last edited by LesFerch; 11 Dec 2021 at 08:16.
      My Computer


  2. Posts : 756
    Windows 10/11
       #32
      My Computer


  3. Posts : 17,013
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #33

    Yes, that's how I do it, that's how I always do it.
    But the particular command used in this case thwarts me.

    I'll just carry on getting the results from the Registry instead.

    Denis
      My Computer


  4. Posts : 17,013
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #34

    LesFerch said:
    If the dialog title is is the same as one of the special folders names (e.g. "Documents"), prefix it with a tilde (this should be a very rare situation):
    Code:
    FileDialog.exe Open C:\Users "*.doc|*.doc" ~Documents Documents false
    One parameter too many?

    That comma in the Registry entry is making processing difficult.No, it's not.

    I've been testing the new version and all seems well. I'll refine the 'calling' batch files and post back.

    All the best,
    Denis
      My Computer


  5. Posts : 756
    Windows 10/11
       #35

    Try3 said:
    One parameter too many?
    Yup. Corrected.
      My Computer


  6. Posts : 17,013
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #36

    Les, pokee,

    I've written a pair of batch files containing the code that I will copy to individual operational batch scripts that need Folder or File dialogs.
    - These batch file 'callers' are complete procedures so they can be run as demonstrators without any changes being necessary.
    - I have stuck in REM lines to show where the scripts would be tailored to the needs of individual operational batch scripts. No other changes should ever be necessary.
    - I have tested them in Windows 10 & Windows 11
    - Both can cope with paths and filenames containing spaces and ampersands [&] and both can cope with the folder/file dialog being cancelled.
    - I have written separate Dialog-SelectFolder.bat and Dialog-SelectFile.bat files because the ifs, buts and maybes in a single combined file would be to awkward to work with [I think I'd make mistakes copying the code into operational scripts].

    I've zipped them up along with the current version of FileDialog.exe [which is common to both batch scripts].
    FileDialog with batch file callers.zip

    Using Dialog-SelectFolder.bat
    Wanted: Sample scripts to cannibalize-dialog-selectfolder-1.png
    Wanted: Sample scripts to cannibalize-dialog-selectfolder-2.png

    Using Dialog-SelectFile.bat
    Wanted: Sample scripts to cannibalize-dialog-selectfile-1.png
    Wanted: Sample scripts to cannibalize-dialog-selectfile-2.png
    Wanted: Sample scripts to cannibalize-dialog-selectfile-3.png

    If I had a day to spare, I'd also write equivalent PS1 callers to use within operational PS scripts.

    Les - I did not use HKCU\Software\FileDialog ItemListM.

    All the best,
    Denis
      My Computer


  7. Posts : 17,013
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #37

    pokee,

    I appreciate that you're well down the road of implementing an HTA solution.
    If you decide to use FileDialog.exe instead, I can explain how to 'spawn' onscreen message boxes to display your instructions to your users.
    They are actually vbs MsgBoxes initiated by batch code.

    You'd no doubt want to discuss things further but here is an example of such a batch file MsgBoxSpawner.
    MsgBoxSpawner - PokeeVersion.zip
    - It is an innocuous demonstrator.
    - It is my 'template' version that I use to copy code into real batch files.
    - It opens a particular variant of message box using the values set in the batch file [which are what I'd expect you to want to tailor to your own requirements].
    - If the display is blank when the MsgBox opens, the display is woken up so it can be seen. This is normally only useful at the end of long procedures such as backups.
    - When you close the MsgBox, the batch file tells you which button was pressed.
    Wanted: Sample scripts to cannibalize-msgboxspawner-pokeeversion-1.png
    Wanted: Sample scripts to cannibalize-msgboxspawner-pokeeversion-2.png


    Best of luck,
    Denis
      My Computer


  8. Posts : 720
    Win10 x64 Pro - 2 desktops, 2 laptops
    Thread Starter
       #38

    LesFerch said:
    Can you post what you have so far? I'm sure I can sort out the error once I see the code.
    Sorry for the delay but I needed to rework the vbs code to get it back to a working version. I commented out Sub and End Sub and hardcoded a variable that I really want passed as an argument. As it stands the code reads an M3U file, makes the needed changes, outputs a temporary file, and starts MediaMonkey with a parameter that causes it to read the modified M3U file.

    This routine assumes that it lives in a utilities folder with sibling folders MediaMonkey (containing MediaMonkey.exe) and FDMusic (containing the music library).

    There's also an hta that prompts for the playlist file name. I would like it to invoke ImportSBDM3U.vbs or have that vbs code incorporated into the script section. I have not been able to get either to work.

    - - - Updated - - -

    Try3 said:
    pokee,
    I appreciate that you're well down the road of implementing an HTA solution.
    If you decide to use FileDialog.exe instead, I can explain how to 'spawn' onscreen message boxes to display your instructions to your users.
    They are actually vbs MsgBoxes initiated by batch code.
    That's actually a pretty simple solution. I hadn't tried building a multi-line MsgBox and didn't know it could be done. Actually, a few months ago I couldn't even spell vbs so I'm going though a bit of a learning curve - many absolutely basic concepts are terra incognita. (And I'm not even certain I understand what an "object" is.)

    I still think I'm going to avoid the FileDialog.exe in my solution, if for no other reason, because of the "Unknown Publisher" Open File - Security Warning popup. That will probably worry the users of this tool even if displayed instructions assure them it's OK.

    I guess I should mention that this tool has to run on a non-Admin account. And I should pay attention to that; I've been doing all testing on an account with admin privileges.
    Wanted: Sample scripts to cannibalize Attached Files
      My Computer


  9. Posts : 756
    Windows 10/11
       #39

    pokeefe0001 said:
    I still think I'm going to avoid the FileDialog.exe in my solution, if for no other reason, because of the "Unknown Publisher" Open File - Security Warning popup. That will probably worry the users of this tool even if displayed instructions assure them it's OK..
    That's standard Windows security for any downloaded executable or script. I got that message (as I should) when I first ran or opened your ImportSBDM3U.vbs script. Your users will need to be trained to understand that it's normal and that they just have to uncheck Always ask before opening this file. It's something you'll need to deal with whether you use an HTA or filedialog.exe.

    I'm currently cleaning up your script so that it will run in an HTA. I'll also make a version that uses filedialog.exe. So far, I see some unnecessary repeat filesystem objects and WScript references that must be changed (since it's running under MSHTA.exe instead of WScript.exe). I'll post the code a little later tonight. Tomorrow at the latest.
      My Computer


  10. Posts : 756
    Windows 10/11
       #40

    Here you go: ImportSBDM3U.zip
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 21:03.
Find Us




Windows 10 Forums