Setting a BAT to open a file BY DRAGGING THE FILE ON THE BAT

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Message
Author
Squashman
Expert
Posts: 4465
Joined: 23 Dec 2011 13:59

Re: Setting a BAT to open a file BY DRAGGING THE FILE ON THE

#16 Post by Squashman » 15 Oct 2014 11:59

Ah thats right. I put a PUSHD at the top of all my drag and drop scripts.

PUSHD "%~dp0"

Compo
Posts: 599
Joined: 21 Mar 2014 08:50

Re: Setting a BAT to open a file BY DRAGGING THE FILE ON THE

#17 Post by Compo » 15 Oct 2014 12:00

…or

Code: Select all

@If /I %~x1 Equ .bin (Start "" "%~dp0waffles.exe" -loadbin %1)
<Edit>Changed "%~1" to %1</Edit>
Last edited by Compo on 15 Oct 2014 12:12, edited 1 time in total.

alesimula
Posts: 11
Joined: 15 Oct 2014 09:14

Re: Setting a BAT to open a file BY DRAGGING THE FILE ON THE

#18 Post by alesimula » 15 Oct 2014 12:12

ShadowThief wrote:What happens if you say

Code: Select all

@If /I %~x1 Equ .bin (Start "%~dp0\waffles.exe" -loadbin "%~1")



I tried with

@echo off
Start "" "%~dp0\waffles.exe" "" -nogui -fastboot -loadbin "%~1"

since in other ways it wasnt working at all
this way it starts if the bin is in the same folder as waffles.exe, but if not, it says ERROR bios not found
wich is a folder found in the same directory of waffles.exe AND CHECKED BY WAFFLES.EXE (weird)

alesimula
Posts: 11
Joined: 15 Oct 2014 09:14

Re: Setting a BAT to open a file BY DRAGGING THE FILE ON THE

#19 Post by alesimula » 15 Oct 2014 12:19

Ok PUSHD worked

Squashman
Expert
Posts: 4465
Joined: 23 Dec 2011 13:59

Re: Setting a BAT to open a file BY DRAGGING THE FILE ON THE

#20 Post by Squashman » 15 Oct 2014 12:21

Sometimes it helps if you actually tell us the actual name of the executable and what the executable is supposed to do. Obfuscating what you are trying to do usually leads to 100% confusion 100% of the time.

Compo
Posts: 599
Joined: 21 Mar 2014 08:50

Re: Setting a BAT to open a file BY DRAGGING THE FILE ON THE

#21 Post by Compo » 15 Oct 2014 12:30

alesimula wrote:I tried with

@echo off
Start "" "%~dp0\waffles.exe" "" -nogui -fastboot -loadbin "%~1"

It also helps if you do not edit your post to change it to look like you attempted to do what I posted. We posted at almost exactly the same time so you couldn't have read my post. Your post read differently, (it was based on ShadowThief's).

Additionally, your edit failed since my code is still different to yours!

<Edit>@Squashman
I would suggest that the application/execuatable is likely a Sony Playstation emulator and the loaded file is more than likely an .iso</Edit>

alesimula
Posts: 11
Joined: 15 Oct 2014 09:14

Re: Setting a BAT to open a file BY DRAGGING THE FILE ON THE

#22 Post by alesimula » 15 Oct 2014 12:52

Compo wrote:
alesimula wrote:I tried with

@echo off
Start "" "%~dp0\waffles.exe" "" -nogui -fastboot -loadbin "%~1"

It also helps if you do not edit your post to change it to look like you attempted to do what I posted. We posted at almost exactly the same time so you couldn't have read my post. Your post read differently, (it was based on ShadowThief's).

Additionally, your edit failed since my code is still different to yours!

<Edit>@Squashman
I would suggest that the application/execuatable is likely a Sony Playstation emulator and the loaded file is more than likely an .iso</Edit>


anyway it works now
Actually it was a bin file but... hurray! You totally understood what i was tryin to do.
With an original PlayStation game of course, I got a playstation but it suddenly broke, it was for testing purpose and Sony blocked all of his consoles of my country OF COURSE... :D :D :D :D

Squashman
Expert
Posts: 4465
Joined: 23 Dec 2011 13:59

Re: Setting a BAT to open a file BY DRAGGING THE FILE ON THE

#23 Post by Squashman » 15 Oct 2014 12:57

Compo wrote:<Edit>@Squashman
I would suggest that the application/execuatable is likely a Sony Playstation emulator and the loaded file is more than likely an .iso</Edit>

Yes. I google searched as soon as I saw how he was running that. If the OP would have provided all this information upfront this thread would have been about 20 posts shorter!

alesimula
Posts: 11
Joined: 15 Oct 2014 09:14

Re: Setting a BAT to open a file BY DRAGGING THE FILE ON THE

#24 Post by alesimula » 15 Oct 2014 13:01

Squashman wrote:
Compo wrote:<Edit>@Squashman
I would suggest that the application/execuatable is likely a Sony Playstation emulator and the loaded file is more than likely an .iso</Edit>

Yes. I google searched as soon as I saw how he was running that. If the OP would have provided all this information upfront this thread would have been about 20 posts shorter!


Exactly :mrgreen:

Compo
Posts: 599
Joined: 21 Mar 2014 08:50

Re: Setting a BAT to open a file BY DRAGGING THE FILE ON THE

#25 Post by Compo » 15 Oct 2014 13:09

It would still have been nice if the attempt I made had actually been tried:

Code: Select all

@If /I %~x1 Equ .bin (Start "" "%~dp0epsx.exe" -nogui -fastboot -loadbin %1)
included corrected execuatable name

Squashman
Expert
Posts: 4465
Joined: 23 Dec 2011 13:59

Re: Setting a BAT to open a file BY DRAGGING THE FILE ON THE

#26 Post by Squashman » 15 Oct 2014 13:10

Compo wrote:It would still have been nice if the attempt I made had actually been tried:

Code: Select all

@If /I %~x1 Equ .bin (Start "" "%~dp0epsx.exe" -nogui -fastboot -loadbin %1)
included corrected execuatable name

I agree Compo. Your code should work flawlessly.

alesimula
Posts: 11
Joined: 15 Oct 2014 09:14

Re: Setting a BAT to open a file BY DRAGGING THE FILE ON THE

#27 Post by alesimula » 15 Oct 2014 13:22

Compo wrote:It would still have been nice if the attempt I made had actually been tried:

Code: Select all

@If /I %~x1 Equ .bin (Start "" "%~dp0epsx.exe" -nogui -fastboot -loadbin %1)
included corrected execuatable name


Yep now it works (I mean, i had tried with the code similiar to this before but it didnt work)
PS: little detail: ePSXe.exe
thx :wink:

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: Setting a BAT to open a file BY DRAGGING THE FILE ON THE

#28 Post by foxidrive » 16 Oct 2014 00:47

alesimula wrote:facts proves the contrary


Questions without actual facts often result in answers that don't work, and also long threads trying to find out what the actual requirements are.

potato and waffle and hiding all paths does actually make it difficult to give you an appropriate answer,
but with actual details you are very likely to get a working solution in just one reply.

Post Reply