The problem I was having with AdminMisc and the C++ Runtime Error is a result of Windows 2000 SP1.
 
After you install Service Pack 1 on Windows 2000, the RunAS command may not function properly.

When you type runas /? at a CMD prompt, the following is displayed:

RUNAS USAGE:  RUNAS [/profile] [/env] [/netonly] /user:<UserName> program     /profile        if the user's profile needs to be loaded    /env            to use current environment instead of user's.    /netonly        use if the credentials specified are for remote access only.    /user            should be in form USER@DOMAIN or DOMAIN\USER    program         command line for EXE.  See below for examples  Examples: > runas /profile /user:mymachine\administrator cmd > runas /profile /env /user:mydomain\admin "mmc %windir%\system32\dsa.msc" > runas /env /user:[EMAIL PROTECTED] "notepad \"my file.txt\""  NOTE:  Enter user's password only when prompted. NOTE:  USER@DOMAIN is not compatible with /netonly.
The format of the /user: entries are:

 [EMAIL PROTECTED]    

UPN (User Principal Name). 

 mydomain\admin 

Security Principal \ UserName syntax, where Security Principal is your down-level domain name. 

mymachine\administrator 

 Security Principal \ UserName syntax, where Security Principal is your local computer name. 
<UserName> 
 Plain UserName syntax, where the Security Principal is determined by the RunAs command, based upon whether the computer is a domain member or a standalone computer. 

If you use the UPN, the program starts, but you receive:

Microsoft Visual C++ Runtime Library Runtime Error! Program "path to executable" abnormal program termination.
If you use the <UserName> syntax on a standalone computer, the same error occurs.

If you use the <UserName> syntax on a domain member or domain controller, you receive:

RUNAS ERROR: Unable to run - "command" 1326: Logon failure: unknown user name or bad password.
You may also experience these problems with MMC.EXE and Ntbackup.exe.

Occasionally, when the RunAS command tries to convert the UserName syntax to the Security Principal \ UserName syntax, it errors, failing to grant desktop access to the user.

The solution is to always use the Security Principal \ UserName syntax, forgoing the UPN and UserName syntax, until the problem is fixed in a future Service Pack.

regards

Ivano

 

 

MY ORIGINAL POST:
__________________________________________________________
 have found that running some applications, rather ordinary applications, as an Admin using Adminmisc gives this "Microsoft Visual C++ Runtime Library" error. Others, like Server Manager, User Manager, etc..works. All the necessary security policies have been set. Has anybody come across this, and how can I solve this?

Here's a snipit:

use Win32::AdminMisc;
$result=3DWin32::AdminMisc::LogonAsUser('domain','userid','password',LOGON32_LOGON_INTERACTIVE);
if ($result){
     $process =3D "c:\\program files\\textpad 4\\textpad.exe";
     $LogonUser =3D Win32::AdminMisc::GetLogonName();
     Win32::AdminMisc::CreateProcessAsUser($process);
}else{
print "\nFailed to logon.\n";
}

thx
Ivano
 
____________________________________________________________


Get more from the Web. FREE MSN Explorer download : http://explorer.msn.com

Reply via email to