Jump to content
LaunchBox Community Forums

bat with ahk


paulmichel21

Recommended Posts

Are you looking for a complete script or just the best way to run a bat file in an autohotkey script you already started?


; Set batch file path

batchpath = c:\example\example.bat



; Run bat script, hide cmd window

Run, %comspec% /c %batchpath%,,Hide

The above is most likely what you are looking for, if not let me know.

Link to comment
Share on other sites

If you just want to run Xpadder for the emulator and exit Xpadder when closing the game, just use this in the ahk tab:


run, r:\somefolder\xpadder /m



$Esc::



{

        Run, c:\windows\system32\taskkill.exe /f /im Xpadder.exe

        Process, Close, {{{StartupEXE}}}

}

This assumes you use escape and/or controller automation to exit your games. Change the paths to match where your files are.

Link to comment
Share on other sites

6 hours ago, ckp said:

If you just want to run Xpadder for the emulator and exit Xpadder when closing the game, just use this in the ahk tab:




run, r:\somefolder\xpadder /m







$Esc::







{



        Run, c:\windows\system32\taskkill.exe /f /im Xpadder.exe



        Process, Close, {{{StartupEXE}}}



}

This assumes you use escape and/or controller automation to exit your games. Change the paths to match where your files are.

Awesomeeeeee....!!!!! Thanks. 

I add line to load the profiles and work very well


run, r:\somefolder\xpadder /m r:\somefolder\profiles\somename_profile /m

Link to comment
Share on other sites

11 hours ago, CoinTos said:

Are you looking for a complete script or just the best way to run a bat file in an autohotkey script you already started?




; Set batch file path



batchpath = c:\example\example.bat







; Run bat script, hide cmd window



Run, %comspec% /c %batchpath%,,Hide

The above is most likely what you are looking for, if not let me know.

excelent. But something is wrong, I need to open that bat by pressing the Esc key

like this


$Esc::Run, %comspec% /c %batchpath%,,Hide

but dont works.

any idea?

Link to comment
Share on other sites

36 minutes ago, paulmichel21 said:

excelent. But something is wrong, I need to open that bat by pressing the Esc key

like this






$Esc::Run, %comspec% /c %batchpath%,,Hide

but dont works.

any idea?


$Esc::Run, %comspec% /c "c:\example\example.bat",,Hide

Change the example path and bat file to yours and that should work. 

Link to comment
Share on other sites

On 22/11/2016 at 10:56 AM, CoinTos said:



$Esc::Run, %comspec% /c "c:\example\example.bat",,Hide

Change the example path and bat file to yours and that should work. 

mmm dont works.. 

code:

 

batchpath = E:\Hyperspin\emulators\irocker\killprocess.bat

$Esc::Run, %comspec% /c "E:\Hyperspin\emulators\irocker\killprocess.bat",,Hide

 

any idea?

Link to comment
Share on other sites

12 hours ago, paulmichel21 said:

mmm dont works.. 

code:

 

batchpath = E:\Hyperspin\emulators\irocker\killprocess.bat

$Esc::Run, %comspec% /c "E:\Hyperspin\emulators\irocker\killprocess.bat",,Hide

 

any idea?

I would have to see the batch file because my test.bat launched every time with either way, hardcoded ($Esc::Run, %comspec% /c "c:\scripts\test.bat",,Hide) or with variable defined at top (batchpath=c:\scripts\test.bat) and set in command ($Esc::Run, %comspec% /c %batchpath%,,Hide)

5 hours ago, paulmichel21 said:

I install autohotkey and i create file ahk with this code and add application in game and works.. for some one razon ahk dont work with LB in this app

So you got working then outside of launchbox ahk?

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...