Runas

vbscript

    Next

  • 1. How2Set default IE6 FileSaveAs Window to Details&MostRecent&*.mht
    Does anyone know if there is a way to set the default IE 6 File...SaveAs Window to: A. [1]Details [2]with Most Recent files at the top, and [3] save as "Web archive, single file (*.mht)"? B. ....with the filename as the first column, with date modified as the 2d column? Thanks, Marceepoo
  • 2. Classic ASP VBscript dates.
    Is there an easy way to return the following date format in Classic ASP? yyyymmdd ? Also, what about the broken down versions? yyyy mm dd ? This is to help me build a MySQL compatible date format. Regards, Gary.
  • 3. Hide client side VBscript in html page
    Hi, Sorry if this is a stupid question, but I'm a bit new to vbscript... We've got a client app written so it uses client side vb script in a few html pages to provide basic functionality (don't ask why, someone else designed it!). The problem is, you can do the classic 'right click, view source' and find out exactly how it all works. Not too great eh? My first question is: Is there a way to remove the vbscript and compile / obfuscate it into a package which can be included into the project? Now, we've also got a web site which is also vbscript heavy which has the same problem. And so, same question again for this... Thanks in advance, Martin Pritchard
  • 4. HELP me with this question about VBScript PLZ
    When might a client-side VBScript be a valid choice of technology when > undertaking a Web site project? > > A..When the pages will incorporate dynamaic functionality and the site is > aimed at a public audience.. > > B. When a site will require that Java applets can be manipulated... > > C. When developing applications on the web site > > D. When the site will require support of form objects on an intranet... >

Runas

Postby Clas Hortien » Fri, 04 Jun 2004 20:05:24 GMT

Hello,

is there a better way to pass the password to a 
running runas process than using appactivate and sendkeys ?

sub ShellRunas(sCmd, sPw, iStyle)
  Dim oShell
  Set oShell = CreateObject("WScript.Shell")
  oShell.run sCmd, iStyle, false
  do while not oShell.AppActivate("runas.exe") 
  	call wait(100)
  loop
  oShell.SendKeys sPw & "~"
  call WaitUntilFileOrSec(sOutFile,10)
  set oShell = Nothing
end sub

The AppActivate dosn't work properly everytime. 
It happens that the Application isn't activated.

Best Regards

      Clas


-- 
The light at the end of the tunnel,
was switch off due to high costs.

Re: Runas

Postby Torgeir Bakken (MVP) » Fri, 04 Jun 2004 23:07:12 GMT


Hi

You might get something to work using a Runas wrapper utility or similar,
take a look here:

 http://www.**--****.com/ %40hydro.com


-- 
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
 http://www.**--****.com/ 

Similar Threads:

1.Set 'RunAs' property programmatically for WinForms VB.Net applicat

Hi,

in a .Net 1.1 WinForms application I have a dialog that lets the user set 
new network credentials. 

Question: How can I assign the new credentials - say nc, defined by

Dim nc = New System.Net.NetworkCredential(M_User, M_Password, M_Domain)

- to the running (VB.Net -) application, so that the application behaves 
like being started in 'RunAs' dialog?

Thanks for help in advance!

-- 
Best regards

Henry

2.how to get the Process Username with runas /netonly

Dear all,

I am trying to get the Process UserName by using System.Enviorment.Username,
I have no problem by normal "run" and by "runas". I can get the process
Username with correct value. However, I try to use "runas /netonly" to
execute the program I developed, I found out that it is returning the local
logon username. But I would like to get the user credential for the remote
access. How?




3.Runas Printer problem

VB6 under Win2K

We have a menu app where we launch applications under different profiles for
security reasons.  The problem that arises is when printing.  That is, the
default printer is the one under the profile which the application was
launched and not the local user.  And we need to have print cabilities for
local user and new profile.  The problem is getting to the local profile
printer settings.

So it's like this:

Menu app (as local user) -> Launch App (different profile) -> Need Print
capibilities as local user and profiile app is launched as.


How can I access the local profile's default printer or How can I pick which
profile I want to print from?

Thanks in advance,

Bill


4.How To Handle RUNAS Password Using The Process Object

I'm trying to use the Process object to have RUNAS run DOS commands.  I have
no problem getting the Process object to run DOS commands and return the
resulting text back to the program.  However, if I'm using RUNAS (e.g. in
order to move files to a protected network share), I run into the problem
that RUNAS requires a two-step process to get it started.

If you're calling RUNAS from the command prompt, after entering the command
line text and hitting ENTER, you're then asked for the password.  RUNAS's
command line does now allow you to include the password, so it's a two-step
process.

I've been trying to work with objMyProcess.RedirectStandardInput and
objMyProcess.StandardInput to feed it the password, but nothing seems to be
working.

The following is my code.  The MsgBox line returns "Enter password for
MyDomain\MyUsername:RUNAS ERROR: Unable to change echo mode"
Dim p As New Process()
Dim psi As New ProcessStartInfo("C:\WINNT\system32\runas.exe", _
"/profile /user:MyDomain\MyUsername " & """" & "c:\winnt\system32\xcopy.exe
/V /Y C:\MyFile.txt \\MyServer\MyShare\SomeFolder" & """")

psi.UseShellExecute = False
psi.RedirectStandardInput = True
psi.RedirectStandardOutput = True
psi.RedirectStandardError = True
psi.CreateNoWindow = True
p.StartInfo = psi
p.Start()
p.StandardInput.AutoFlush = True
p.StandardInput.WriteLine("MyPassword")
MsgBox(p.StandardOutput.ReadToEnd)
p.StandardInput.Flush()
p.StandardInput.Close()
p.StandardOutput.Close()
p.Close()
p = Nothing



5.Runas

Hello,

I work for a company where the server administrators have two login ID's. 
One without admin right that we use to log into our workstations and one with 
admin rights that we use to for server administration. A co-worker and I put 
together an app in VB.Net that lets us click a button to do things that 
require admin rights like opening certain applications. We use runas to open 
the app with our admin id's and then any option we select opens using the 
admin credentials. Everything works fine with the exception of opening a UNC 
path. 

process.start(explorer, "\\server\share")        'does nothing

process.start("\\server\share")     'will open the UNC path, but not with 
the administrative credentials that the app runs under. We are prompted for 
credentials and when we enter the id and password that the app runs under the 
path is opened no problem. 

Has anyone seen this problem before, or have any suggestions?

Thanks!!

Chad


6. creating "runas" shortcut through vb script

7. Runas command with encrypted password

8. runas substitute



Return to vbscript

 

Who is online

Users browsing this forum: No registered users and 64 guest