Sign in to follow this  
Followers 0
Stimorol

Translating Batch into AUTOIT

5 posts in this topic

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?

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

"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
1 person likes this

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Try this line instead:
 

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

Br,

UEZ

Edited by UEZ
1 person likes this

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!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
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")
1 person likes this

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

Share this post


Link to post
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.

Share this post


Link to post
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
Sign in to follow this  
Followers 0