I'm kicking off the startup script per the following in my ServiceDefinition.csdef
<Startup>
<Task commandLine="Microsoft.WindowsAzure.Caching\ClientPerfCountersInstaller.exe install" executionContext="elevated" taskType="simple" />
<Task commandLine="startup.cmd" executionContext="elevated" taskType="simple" />
</Startup>
The startup.cmd file is
@echo off
REM StartupLog.txt can be found at (E or F):\approot\bin
Echo Copying MyUtil to system root >> StartupLog.txt 2>&1
copy /y MyUtil.exe %SystemRoot% >> StartupLog.txt 2>&1
IF ERRORLEVEL 1 GOTO ErrorExit
REM It's ok if the next fails, the task may not be scheduled 1st time
Echo Trying to delete MyUtil from scheduler >> StartupLog.txt 2>&1
schtasks /Delete /F /TN "MyUtil" >> StartupLog.txt 2>&1
Echo Adding MyUtil to Scheduler >> StartupLog.txt 2>&1
schtasks /Create /SC MINUTE /MO 2 /SD 11/01/2012 /TN "MyUtil" /TR %SystemRoot%\MyUtil.exe >> StartupLog.txt 2>&1
IF ERRORLEVEL 1 GOTO ErrorExit >> StartupLog.txt 2>&1
GOTO End
:ErrorExit
REM Report the date, time, and ERRORLEVEL of the error.
%ERRORLEVEL% >> StartupLog.txt 2>&1
DATE /T >> StartupLog.txt 2>&1
TIME /T >> StartupLog.txt 2>&1
ECHO An error occurred during startup. ERRORLEVEL = %ERRORLEVEL% >> StartupLog.txt 2>&1
ECHO ----------------------------------------------------------- >> StartupLog.txt 2>&1
EXIT /B 1
:End
ECHO Exiting at end with 0 >> StartupLog.txt 2>&1
ECHO ----------------------------------------------------------- >> StartupLog.txt 2>&1
EXIT /B 0
The error in (E: or F:)\approot\bin is :
Copying MyUtil to system root
1 file(s) copied.
Trying to delete MyUtil from scheduler
SUCCESS: The scheduled task "MyUtil" was successfully deleted.
Adding MyUtil to Scheduler
ERROR: No mapping between account names and security IDs was done.
(43,4):LogonType:'1' is not recognized as an internal or external command,
operable program or batch file.
If I run the startup.cmd file after RDPing into the WebRole then the tasks get added to the scheduler just fine. For some reason it always fails through deployment. Does anyone know how to fix this? I reverted to OSVersion=2 till I can fix this issue.