概要
Windows XP には、別アカウントでプログラムを実行するためのRunAsというコマンドが付属しています。
しかし、この標準のRunAsコマンドでは、コマンドを使用するたびにパスワードを入力する必要があります。
これでは、バッチファイル等で使用する際に不便なので、コマンドライン上からパスワードを指定する機能を付加したコマンドを作りました。
ライセンス
Copyright (c)2007 Kazuyoshi Kakihara
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
使用方法
RunAsPW.zipを展開して出てくる、RunAsPW.exeが実行ファイルになります。
RunAsPWはコマンドラインツールです。
RUNASPW [ [/noprofile | /profile] [/env] [/netonly] [/wait]]
/user:<ユーザー名> /password:<パスワード> プログラム
/noprofile ユーザーのプロファイルを読み込まないように指定します。
この結果、アプリケーションをより速く読み込むことができま
すが、一部のアプリケーションが正しく動作しない可能性があ
ります。
/env ユーザーの環境ではなく、現在の環境を使用する場合に使います
/wait 起動したプログラムの終了を待ちます
/user <ユーザー名> の形式は、"ユーザー@ドメイン" または
"ドメイン\ユーザー" です
/password パスワードを指定します
プログラム 実行可能なコマンドラインです。下の例を参照してください。
例:
> runaspw /noprofile /user:mymachine\administrator cmd
> runaspw /env /user:user@domain.microsoft.com "notepad \"my file.txt\""