Author Topic: Running a batch file from Voice attack  (Read 1423 times)

Bumble B

  • Jr. Member
  • **
  • Posts: 64
    • Bumble B Gaming
Running a batch file from Voice attack
« on: March 02, 2020, 03:58:03 AM »
Hi there guys and gals, its been a REALLY long time but I'm still loving Voice Attack and using it pretty much with everything i do.

I've been into sim racing of late and running a program called CrewChief.

I have Project CARS2 and Assetto Corsa and trying to make a script/batch script to start CrewChief set to either of those games without having to come out of VR.

In there FAQ I saw this and trying to work out if this is what I could use.

Quote
Q: How can I start Crew Chief from the command line?
A: To select the game in CC from the command line, pass one of those parameters:
RACE_ROOM, PCARS2, PCARS_64BIT, PCARS_32BIT, PCARS_NETWORK, PCARS2_NETWORK, RF1, ASSETTO_64BIT, ASSETTO_32BIT, RF2, IRACING
To make CC automatically start using this selection, use "run_immediate" Preference option.

Could i basically just write this code:

Code: [Select]
ECHO OFF
ECHO location of crewchief program/ crewchief.exe PCARS_NETWORK

Not at computer right now just kinda got the idea in my head and wanted to make sure i was on the right track
--
CMDR Bumble B ö7
ASUS P6TD Deluxe, Intel i7 960 @ 3.2GHz, 12Gb G.Skill, Windows 7 SP1 (64bit), ASUS Geforce GTX 970 Strix (4Gb), ThrustMaster T-Flight HOTAS X, Cosair Void RGB USB Gaming Headset, TrackIR, EDDI, Voice Attack, ED Engineer

Xariyl

  • Newbie
  • *
  • Posts: 15
Re: Running a batch file from Voice attack
« Reply #1 on: March 02, 2020, 04:43:26 AM »
I'd imagine you could just use the built in Run an Application command in Voice Attack itself. Path to CrewChief in the first line, and PCARS_NETWORK in the parameters line. Shouldn't need a batch file.


If it matters, though, your proposed code is close. Remove the second ECHO; that will just display the line to the command prompt, not actually run the program. Also, if your path to crewchief.exe has any spaces in it, you should wrap the entire path in quotes.

Code: [Select]
@ECHO OFF
"C:\Program Files\Crew Chief\crewchief.exe" PCARS_NETWORK


Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: Running a batch file from Voice attack
« Reply #2 on: March 02, 2020, 09:14:00 AM »
You can indeed use the "Run an Application" action to start CrewChief, with the chosen parameter in the "With these parameters" field.


If you do intend to use a batch file (though it offers no real advantages for launching a single application over the "Run an Application" action), I'd recommend
Code: [Select]
start "" "C:\Program Files\Crew Chief\crewchief.exe" PCARS_NETWORKwhich will only pop up the cmd window momentarily (you could keep the window from appearing at all by choosing the "Hidden" setting of the "Window Style" option, which will not affect CrewChief or any other launched applications, only the cmd window), as it will close automatically once the application is launched.

Code: [Select]
@echo offIs not required, it only makes the output to the cmd window less verbose.

Bumble B

  • Jr. Member
  • **
  • Posts: 64
    • Bumble B Gaming
Re: Running a batch file from Voice attack
« Reply #3 on: March 02, 2020, 04:58:24 PM »
You guys are the best, I already had a voice command to start CrewChief just wasn't sure about the With these parameters bit.

I'm ALWAYS underestimating the power of Voice Attack, after all these years you'd think I'd know better by now :D

You guys always come though with my silly sometimes odd ball questions with the perfect answers
--
CMDR Bumble B ö7
ASUS P6TD Deluxe, Intel i7 960 @ 3.2GHz, 12Gb G.Skill, Windows 7 SP1 (64bit), ASUS Geforce GTX 970 Strix (4Gb), ThrustMaster T-Flight HOTAS X, Cosair Void RGB USB Gaming Headset, TrackIR, EDDI, Voice Attack, ED Engineer