c# - Runas admin (from batch script/cmd) not working properly -


i'm trying batch script run silent install of program. here's line that's causing trouble:

runas /user:domain\admin /savecred start "" "%temp%\myprogram - 4.6.0.0\setup.exe" /silent >> %userprofile%\desktop\batchlog.txt 

a few notes:

  • "" before file location there avoid issues spaces in location of setup.exe
  • /silent parameter passed setup.exe run silent installation
  • >> %userprofile%\desktop\batchlog.txt pipes output log file

when run part of batch script, setup.exe isn't running domain\admin. sharepoint savvy, spfarm.local throwing null ref (it's written in c#), indicating running user doesn't have db access. can spot wrong use of runas here?

running line command line pulls runas screen. i'd find out why that's happening well.

if manually run (double-click) setup.exe (logged in domain\admin) don't null ref, indicating program running domain\admin.

how can fix line execute program domain\admin?

think whole command needs in quotes runas takes 1 "program" parameter. also, start command doesn't seem compatible runas. try this:

runas /user:domain\admin /savecred "\"%temp%\myprogram - 4.6.0.0\setup.exe\" /silent >> \"%userprofile%\desktop\batchlog.txt\"" 

Comments

Popular posts from this blog

java - JavaFX 2 slider labelFormatter not being used -

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -