Jump to content

Autoit & Batch


Recommended Posts

Hi :)

I am trying to record some audio using Linco, however for some reason it won't work!

https://romanrm.net/lineincode

 

This is my batch command that does work! (Somehow run this in Autoit :) )

linco -B 8 -C 1 -R 8000 -D 00:00:10 | oggenc - -r -B 8 -C 1 -R 8000 -o Audio.ogg

 

And this is how I attempted to do it in Autoit

ShellExecute("Linco.exe", "-B 8 -C 1 -R 8000 -D 00:00:10 | oggenc - -r -B 8 -C 1 -R 8000 -o Audio.ogg", @ScriptDir)

I even tried "Run()" and both "Run()" & "ShellExecute" seem to open the application and pass the parameters, however it fills the console (command window) with very strange letters and numbers as if i's not executing properly.

 

Thank you! :) 

Link to comment
Share on other sites

8 minutes ago, Fade91 said:

I tried this but still doesn't work.

 

ShellExecute(@ScriptDir & "\Linco.exe", "-B 8 -C 1 -R 8000 -D 00:00:10 | oggenc - -r -B 8 -C 1 -R 8000 -o Audio.ogg")

It adds a bunch of garbage in the prompt :/

this "|" you have there, is a pipe, use Run( @comspec & ' /c "' & the rest . That should do it.

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

Link to comment
Share on other sites

Run( @comspec & ' /c Linco.exe -B 8 -C 1 -R 8000 -D 00:00:10 | oggenc - -r -B 8 -C 1 -R 8000 -o Audio.ogg')

Perfect, that did it!

Just a few questions though, what is the purpose of ' /c' and what is a pipeline. How does it differ running it with @Comspec vs Run/ShellExecute.

Lots of questions but don't really know where to look for the answers :) 

Edited by Fade91
Link to comment
Share on other sites

Just now, Fade91 said:
Run( @comspec & ' /c Linco.exe -B 8 -C 1 -R 8000 -D 00:00:10 | oggenc - -r -B 8 -C 1 -R 8000 -o Audio.ogg')

Perfect, that did it!

Just a few questions though, what is the purpose of ' /c' and what is a pipeline. How does it differ running it with comspec vs Run/ShellExecute.

Lots of questions but don't really know where to look for the answers :) 

no clue, just my experience.

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

Link to comment
Share on other sites

"/c" stands for "close". Means:

Run( @comspec & ' /c

starts the DOS environment and executes the command. When finished it closes the window and exits. Try "/k" to "keep" the window. Useful when you need to debug your code.

"|" is the DOS pipe character. Means: It grabs the output of the command left of the pipe character and passes it as input to the command right of the character.

Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...