Jump to content

Translating Batch into AUTOIT


 Share

Go to solution Solved by JLogan3o13,

Recommended Posts

Quick and easy.

How do I translate this simple batch script into a working executable with AutoIT:

@echo off
set /p id="Stream: " %=%
cd c:\program files (x86)\livestreamer
livestreamer.exe -url twitch.tv/%id% best

Basically I need the script to run this next command in a CMD and keep it open:

cd c:\program files (x86)\livestreamer&&livestreamer.exe -url twitch.tv/%id% best

I thought it was something like this but it doesnt work:

Local $streamname = InputBox("Livestreamer", "What Stream do you want to watch?", "", "")
RunWait(@ComSpec & ' /k  ' & "cd c:\program files (x86)\livestreamer&&livestreamer.exe -url twitch.tv/"$streamname" best")

Can you help me?

Link to comment
Share on other sites

  • Moderators
  • Solution

"It doesn't work" doesn't help us a lot. What error are you seeing when you run your code?

Edit:

Try changing this:

RunWait(@ComSpec & ' /k  ' & "cd c:\program files (x86)\livestreamer&&livestreamer.exe -url twitch.tv/"$streamname" best")

To this:

RunWait(@ComSpec & ' /k  ' & "cd c:\program files (x86)\livestreamer&&livestreamer.exe -url twitch.tv/" & $streamname & " best")
Edited by JLogan3o13

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

Try this line instead:
 

RunWait(@ComSpec & ' /k  "C:\program files (x86)\livestreamer\livestreamer.exe" -url twitch.tv/' & $streamname & ' best')

Br,

UEZ

Edited by UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

same conclusion:  you may want to start using msgbox to check your commands as the errors tend to stand out when you see the whole string

$streamname = "THISSTREAM"

;your result

msgbox(0 , '' , '"cd c:\program files (x86)\livestreamer&&livestreamer.exe -url twitch.tv/"$streamname" best"')

;what i guess you want

msgbox(0 , '' , "cd c:\program files (x86)\livestreamer\livestreamer.exe -url twitch.tv/" & $streamname & " best")

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Link to comment
Share on other sites

 

"It doesn't work" doesn't help us a lot. What error are you seeing when you run your code?

Edit:

Try changing this:

RunWait(@ComSpec & ' /k  ' & "cd c:\program files (x86)\livestreamer&&livestreamer.exe -url twitch.tv/"$streamname" best")

To this:

RunWait(@ComSpec & ' /k  ' & "cd c:\program files (x86)\livestreamer&&livestreamer.exe -url twitch.tv/" & $streamname & " best")

Thanks Logan.

Also thank you UEZ and boththose.

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