I'm trying to get a batch file to automatically enter the password into the "runas" program, this code is working fine but it is not supported by SQL server agent. Here's my batch file so far:
@if (@CodeSection == @Batch) @then
@echo off
start "" runas /user:testuser c:/path/to/my/program.exe
CScript //nologo //E:JScript "%~F0"
goto :EOF
@end
WScript.CreateObject("WScript.Shell").SendKeys("password{ENTER}");
Please suggest any method to enter a password automatically and it should support the SQL server agent job.