Jump to content
LaunchBox Community Forums

Can the checkbox "Remove file extension and folder path" in the Edit Emulator screen details tab could be separated into two separate check boxes.


rye74

Recommended Posts

 I was wondering if the checkbox "Remove file extension and folder path" in the Edit Emulator screen details tab could be separated into two separate check boxes. One checkbox to remove the file extension and one checkbox  to remove the folder path? Instead of doing both actions with one check box. 
 
I've run into a situation where i want to pass the filename and ext but no path and I can't seem to do it because the way its setup, Please let me know if this is feasible or if there is another way I could accomplish what I'm trying to do.

Screenshot 2023-02-07 062747.png

Link to comment
Share on other sites

40 minutes ago, rye74 said:

I've run into a situation where i want to pass the filename and ext but no path and I can't seem to do it because the way its setup, Please let me know if this is feasible or if there is another way I could accomplish what I'm trying to do.

If your case use is passing it to a batch file, in the batch file you use %1 to reference the full parameter.  Instead, UNCHECK the "Remove file ext..." and in the batch file use %~nx1 in place of %1.  This will result in just the fileName.ext.

 

To test, create a batch (test.bat) with the following:

@echo off
echo %1
echo %~nx1
pause

Drag and drop any file onto "test.bat".  The resulting Command Prompt will display the full path to the file on the 1st line and just the fileName.ext on the 2nd line.

image.png.5c82496dd5afcdac2be23fc089a3d548.png

Link to comment
Share on other sites

Hi Joe. Thanks for the response.

I am using a bat file and do use %~nx1 and did figure out awork around by appending the .ext but i have other apps on different machines which use the same bat file and those changes break my other apps. Not really a big deal but It seems backwards to me to handle two operations with a single checkbox. I don't know if its thats something the devs would wanna change that though.

Edited by rye74
Link to comment
Share on other sites

Appending the .ext was my 1st thought. ;)  

 

1 hour ago, rye74 said:

I don't know if its thats something the devs would wanna change that though.

The best way to set this in motion is to create a bitbucket request.  At the top of this page click HELP & SUPPORT and then REQUEST A FEATURE.  Once completed, add a link to it here to gain exposure and get upvotes.

 

In the interim, you can always create a 2nd batch file for your other 'emulators' that [would] use the same batch file and use %1.  

Or get super crazy and add a Default Command-Line Parameter for the different emulators using the same batch file.  Example "path", "file", "fileExt".  Then in the batch file, add

if %1==path (set param=%2)
if %1==fileExt (set param=%~nx2)
if %1==file (set param=%~n2)
echo %param%

 :D

 

Link to comment
Share on other sites

Yeah, ill have to create another bat for my other app. I believe off the top of my head that this would be useful with batch jobs (my case here), the m2 emulator or model3 emulator and Mame and Openbor. I know in Playnite you can pass just the name of the file with or without the ext or path or any combination.

Edited by rye74
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...