EDIT --turned out not fun at all until I tried on another computer and the autorun did work, dunno why it worked on 1 PC but not the other - YMMV too.
The following files need to be in the root of your USB Drive.
Simplest form of Autorun.inf for USB Drive:
Basic batch file (EPGUpdaterUSB.cmd) to do the copying (important stuff is between the first ==== lines, you'll need to change at least 1 path):
It can copy to and from the USB Drive.
NOTE: The "IF EXIST ..." commands between ==== lines should all be on single line, not on 2 lines as it can appear here. The SET= lines can also appear like that, the paths cannot wrap to the next line in the batch file.
The following files need to be in the root of your USB Drive.
Simplest form of Autorun.inf for USB Drive:
Code:
[autorun]
action=EPGUpdaterUSB
shellexecute=EPGUpdaterUSB.cmd
Basic batch file (EPGUpdaterUSB.cmd) to do the copying (important stuff is between the first ==== lines, you'll need to change at least 1 path):
Code:
@echo off
setlocal
echo.
echo Autorun USB Drive TVGuide Updater!
echo.
rem ==========================================================
rem Set parameters to control execution.
rem Possible Values: 1=On. 0, not set, or any other value=Off.
SET ENABLECOPYTOUSB=1
SET ENABLECOPYFROMUSB=1
rem Set paths to copy from/to.
SET SOURCETVGUIDEPATH=C:\PathWhereYourGuideDataIsDownloaded
SET DESTINATIONTVGUIDEPATH=C:\Program Files\Team MediaPortal\MediaPortal\xmltv
rem ==========================================================
IF /I NOT "%ENABLECOPYTOUSB%"=="1" GOTO CopyToUSBEnd
echo.
rem ==========================================================
IF EXIST "%SOURCETVGUIDEPATH%\tvguide.xml" copy "%SOURCETVGUIDEPATH%\tvguide.xml" .
rem ==========================================================
echo.
echo Copy downloaded TVGuide to USB Drive Done!
:CopyToUSBEnd
IF /I NOT "%ENABLECOPYFROMUSB%"=="1" GOTO CopyFromUSBEnd
echo.
rem ==========================================================
IF EXIST "%DESTINATIONTVGUIDEPATH%\*.*" copy tvguide.xml "%DESTINATIONTVGUIDEPATH%"
rem ==========================================================
echo.
echo Copy TVGuide from USB Drive to MediaPortal Done!
:CopyFromUSBEnd
endlocal
It can copy to and from the USB Drive.
NOTE: The "IF EXIST ..." commands between ==== lines should all be on single line, not on 2 lines as it can appear here. The SET= lines can also appear like that, the paths cannot wrap to the next line in the batch file.
Australia