If you can set your software to run a VBS script, you can install the COM Automation Server from my components page and use the following script with it. Save it to a file called switch-playlists.vbs. You might want to figure out how to parse command line arguments in VBS sou you can select whether to switch to the next or previous playlist. Alternatively, you can save two different versions of the script.
Option Explicit
dim ProgID, HelperProgID
ProgId = "Foobar2000.Application.0.7"
HelperProgID = "Foobar2000.ApplicationHelper.0.7"
dim bStartAlways, bSwitchToNext
'set to true to start foobar2000 if it is not running
bStartAlways = false
'set to false to switch to previous playlist
bSwitchToNext = true
dim oApp
if bStartAlways then
set oApp = WScript.CreateObject(ProgID)
if isnull(oApp) then
WScript.Quit
end if
else
dim oHelper
set oHelper = WScript.CreateObject(HelperProgID)
if isnull(oHelper) or not oHelper.Running then
WScript.Quit
end if
set oApp = oHelper.Server
end if
dim oPlaylists, oPlaylist
dim nIndex, nCount
set oPlaylists = oApp.Playlists
set oPlaylist = oPlaylists.ActivePlaylist
if isnull(oPlaylist) then
nIndex = 0
else
nIndex = oPlaylist.Index
nCount = oPlaylists.Count
if bSwitchToNext then
nIndex = nIndex + 1
if nIndex >= nCount then
nIndex = 0
end if
else
nIndex = nIndex - 1
if nIndex < 0 then
nIndex = nCount - 1
end if
end if
end if
set oPlaylist = oPlaylists(nIndex)
oPlaylists.ActivePlaylist = oPlaylist
oPlaylist.DoDefaultAction 0