Jump to content

Recommended Posts

Posted (edited)
$sURL = "http://1.1.1.1:7539"
$sToken = "ABC123"

Local $aLib[5] = [1, 2, 3, 4, 5]

For $i = 0 To UBound($aLib)-1
    $sLib = $aLib[$i]
    $sPlexTrash = "$sURL$/library/sections/$sLib$/emptyTrash?X-Plex-Token=$sToken$"

    ConsoleWrite(@CRLF & "Emptying Trash - Library $sLib$ - $sPlexTrash$")
    RunWait(@ComSpec & '/c curl.exe -X PUT "$sPlexTrash$"', '', @SW_HIDE)

Next
ConsoleWrite (@CRLF & "<><><><><><><><><><><><><><><><><><><><><><><><><><>" & @CRLF)

I am trying to run a curl command with ComSpec, but its not working

I can run the same command from CMD, and it works just fine

I have a batch file that works perfectly as well

I'm missing something, but I don't know what

Edited by AlchemistZim
Posted (edited)
23 minutes ago, ioa747 said:

try with

RunWait(@ComSpec & ' /c curl.exe -X PUT "' & $sPlexTrash & '"', '', @SW_HIDE)

 

Edit:
To run DOS commands, try RunWait(@ComSpec & " /c " & "commandName")    ; don't forget " " before "/c"

That worked

Show how is ("' & $sPlexTrash & '") different from  ("$sPlexTrash$")

i usually use the CMD abbreviation in AutoIt, I changed it based on a suggestion from another thread

***FIGURED IT OUT***

Forgot to add the space after ComSpec before the /c so it was rendering as "cmd.exe/c" instead of "cmd.exe /c"

Edited by AlchemistZim

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
×
×
  • Create New...