Re: "Run As," Adding Names to Drop-Down Box
- From: "WTC" <bcrawfordjr(remove)@hotmail.com>
- Date: Wed, 21 Mar 2007 10:20:23 -0700
"M.H." <REMOVEmstTHIScrowTO5429SEND@xxxxxxxxxxxxx> wrote in message
news:%xdMh.16023$Jl.4497@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
WTC wrote:
"M.H." <REMOVEmstTHIScrowTO5429SEND@xxxxxxxxxxxxx> wrote in messageOh, nm, regarding the cmd, if I enter the right password, the program
news:D71Mh.14706$tD2.6109@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
WTC wrote:
"M.H." <REMOVEmstTHIScrowTO5429SEND@xxxxxxxxxxxxx> wrote in messageI discovered that I made an error in the username. It's not MHxxxx,
news:nL_Lh.129620$_73.59636@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
WTC wrote:
"M.H." <REMOVEmstTHIScrowTO5429SEND@xxxxxxxxxxxxx> wrote in messageHere is what I have:
news:K2WLh.14597$tD2.11093@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
WTC wrote:Ok on the first run as command make sure you have the path to the
I am not sure if what you ask for can be done but their is anNeither of those are working properly for me. The former, I get a
alternative.
Simply created a file called, "MyProgram.cmd" with notepad. Then
use
the
following to start the desired program with different user
credentials.
Contents of "MyProgram.cmd"
-------
runas /user:username "c:\program files\myprogram.exe"
----
You will be asked for a password, simply type in the password for
the
username you specified to start the program.
Or you can create Script called "MYProgram.vbs" with the user
credentials
already supplied.
Contents of "MyProgram.vbs"
-------
set WshShell = CreateObject("WScript.Shell")
WshShell.Run "runas /user:Username ""C:\Program
Files\myprogram.exe"""
WScript.Sleep 100
WshShell.Sendkeys "password~"
--------
CLI
prompt to enter my password. I do that, window closes, nothing
happens.
Second one, I see a window flash, then nothing. I click on the .exe
at
C:\Program Files\myprogram\myprogram.exe, it starts up without any
problem.
program
wrap in quotes ("C:\Program Files\myprogram.exe"). Also make sure you
replace Username with you user account.
On the second one, the script, make sure you have the quotations
exactly
like I have in the script. Also, replace Username with your User
Account
Name. Change 100 to 500. If your password is 123456 then make sure
the
password you enter has the ~ at the end like this "1234656~".
LibertyBasic.cmd
-----
runas /user:MHxxxxx "C:\Program Files\Liberty BASIC v4.03\liberty.exe"
-----
LibertyBasic.vbs
-----
set WshShell = CreateObject("WScript.Shell")
WshShell.Run "runas /user:MHxxxxx ""C:\Program Files\Liberty BASIC
v4.03\liberty.exe"""
WScript.Sleep 500
WshShell.Sendkeys "xxxxx~"
-----
The only change made was "Sleep 500" from "Sleep 100." I'm still
getting for the cmd a CLI prompt to enter password, then nothing, and
for the VBS a window that flashes for slightly longer (I think, as is
that what "Sleep" does?) and then disappears.
Could you open the Command Prompt and type:
runas /user:MHxxxxx "C:\Program Files\Liberty BASIC v4.03\liberty.exe"
Does any errors occur? If there is an error, it will also affect the
"LibertyBasic.vbs" script.
it's M. Hxxxx. Now when I type runas /user:M. Hxxxxx "C:\Program
Files\Liberty BASIC v4.03\liberty.exe" in the CLI, and then the
password, it says:
RUNAS ERROR: Unable to run - C:\Program Files\Liberty BASIC
v4.03\liberty.exe
1326: Logon failure: unknown user name or bad password.
If you have spaces in the username like M. Hxxxx then put quotes around
it
like "M. Hxxxx". So now the runas line should look like this:
runas /user:"M. Hxxxx" "C:\Program Files\Liberty BASIC v4.03\liberty.exe"
Change the script file as well.
starts. Just if you enter the wrong password, the window closes,
without prompting the user to re-enter the password.
Glad you got that sorted out.
--
William Crawford
MS-MVP Windows Shell/User
.
- References:
- "Run As," Adding Names to Drop-Down Box
- From: M.H.
- Re: "Run As," Adding Names to Drop-Down Box
- From: WTC
- Re: "Run As," Adding Names to Drop-Down Box
- From: M.H.
- Re: "Run As," Adding Names to Drop-Down Box
- From: WTC
- Re: "Run As," Adding Names to Drop-Down Box
- From: M.H.
- Re: "Run As," Adding Names to Drop-Down Box
- From: WTC
- Re: "Run As," Adding Names to Drop-Down Box
- From: M.H.
- Re: "Run As," Adding Names to Drop-Down Box
- From: WTC
- Re: "Run As," Adding Names to Drop-Down Box
- From: M.H.
- "Run As," Adding Names to Drop-Down Box
- Prev by Date: Re: Free virtual machine with a SATARaid HDD configuration?
- Next by Date: RE: Continuous service start error shows in Error Log at every boo
- Previous by thread: Re: "Run As," Adding Names to Drop-Down Box
- Next by thread: Re: how to maximize window content
- Index(es):
Relevant Pages
|