vbscript - Running an application as a different user (.bat / .vbs) -


i need restart application using service running on system account. problem application started under system account. various reasons beyond control restart system bit complicated result of complicatedness(c) i'm sure there must @ least 1 stage possible specify account app run on.

the service calls bounce.bat contains following:

@echo off cscript "c:\program files\myapp\bounce.vbs" 

the relevant section of bounce.vbs is:

set oprocess = owmiservice.get("win32_process") set oprogram = oprocess.methods_("create").inparameters.spawninstance_ oprogram.commandline = spath & sexe   set sshell = owmiservice.execmethod("win32_process", "create", oprogram) 

if there no clever suggestions i'll try this approach, i'm sure there must cleaner way.


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -