2017-09-11 21 views
-1

私はバッチ/ CMDで実行しているプログラムを持っていて、それを実行するにはまずadminを介してcmdを開いてから、自分のプログラムを開く必要があります。管理者としてcmdの前にopenningせずに管理バッチプログラムとして実行する方法はありますか?バッチを管理者として実行するには?

runas /user:administrator myscript.cmd 

あなたは/savecred

でそれを実行する必要があります明らかに用いることができる他のスイッチがあるので、CMDラインからrunas /?を実行すると得られます:あなたはちょうどrunasコマンドでそれを実行する必要が

答えて

0

利用可能なスイッチ。

/noprofile  specifies that the user's profile should not be loaded. 
       This causes the application to load more quickly, but 
       can cause some applications to malfunction. 
/profile   specifies that the user's profile should be loaded. 
       This is the default. 
/env    to use current environment instead of user's. 
/netonly   use if the credentials specified are for remote 
       access only. 
/savecred   to use credentials previously saved by the user. 
/smartcard  use if the credentials are to be supplied from a 
       smartcard. 
/user    <UserName> should be in form [email protected] or DOMAIN\USER 
/showtrustlevels displays the trust levels that can be used as arguments 
       to /trustlevel. 
/trustlevel  <Level> should be one of levels enumerated 
       in /showtrustlevels. 
program   command line for EXE. See below for examples 
関連する問題