Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

runas?

705 views
Skip to first unread message

sasa

unread,
Dec 17, 2003, 2:38:52 PM12/17/03
to
Hello,

Is there a way to run an exe file as a runas command with a wsh file. Since
the program can be isntalled as a power user or adminsitrator I would have
to write a program that would run an exe file.
I am not that good in wsh so anything would help with RUNAS. The password
contains usually symbols.

Thanks

Torgeir Bakken (MVP)

unread,
Dec 17, 2003, 2:53:16 PM12/17/03
to
sasa wrote:

Hi

Here are some utilities that might help you:


If it doesn't matter if the password is in clear text:

Sanur Commandline Runas Automation Utility (free)
http://www.commandline.co.uk/sanur/


if it does:

Some 3rd party RunAs solutions that "hides" (encrypt) username/password
are listed in the link below (buy solutions). Can be run from network shares,
so nothing needs to be installed on the client computers.

http://groups.google.com/groups?selm=3E272913.27CBE26D%40hydro.com


A couple of free tools that "hides" (encrypt) username/password:

CPAU on the free win32 c++ tools page of
http://www.joeware.net


And from a recent post by Peter M.:

<quote>
I am currently using AutoIt V3 (http://www.hiddensoft.com/autoit3/)
It includes a command to run a command as a special user. You can
write a simple script and then compile it with autoit as an executable.
Protect this executable with a password and you are done.

AutoIt V3 ist still beta and under development, but the actual version
is stable and the functions you need (runasadmin,regwrite...) are
already implemented and working.
</quote>

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


sasa

unread,
Dec 17, 2003, 4:55:42 PM12/17/03
to
I have tried it with a batch file.
How do you put it into a wsh file?
thanks
"Torgeir Bakken (MVP)" <Torgeir.B...@hydro.com> wrote in message
news:3FE0B42C...@hydro.com...

Jason

unread,
Dec 17, 2003, 5:32:25 PM12/17/03
to
Well, there is no such thing as a "wsh" file. The wsh,
or Windows Scripting Host is a mechanism by which scripts
written in JScript or VBScript can be compiled and run.

>.
>

Joe Earnest

unread,
Dec 17, 2003, 6:12:15 PM12/17/03
to
Hi,

"Jason" <anon...@discussions.microsoft.com> wrote in message
news:001701c3c4ed$a55c03b0$a401...@phx.gbl...


| Well, there is no such thing as a "wsh" file. The wsh,
| or Windows Scripting Host is a mechanism by which scripts
| written in JScript or VBScript can be compiled and run.

This is off-subject, but just FYI - there are WSH files. They are sort of
INI-like VBS and JS file initiation files. The following ias from the MS
WSH CHM file. Most people probably mean VBS or JS files when they refer to
"wsh files".

---
You can record specific settings for each of your individual scripts by
means of a Windows Script Host control (.wsh) file. The .wsh file is a text
document in which you can customize execution of one or more of your
scripts. It is created automatically when you set the properties for a
supported script file.

If you create multiple .wsh files for a single script, you can tailor the
way the script runs to the needs of specific groups or even individuals
within an organization. For example, you could create a single logon script
that is invoked by two different .wsh files that contain different settings
and parameters.

When you double-click a .wsh file or run it from the command line,
CScript.exe or WScript.exe reads the .wsh file to determine the specific
settings that should be used to execute the script. CScript/WScript executes
the original script, passing in the properties that are defined within the
.wsh file.

To create a .wsh file for a given script

1.. Right-click the script file in Windows Explorer.
2.. Click Properties on the shortcut menu.
3.. Choose the settings you want for the script.
4.. Click OK or Apply.
A .wsh file is created with the same name as the script file you selected.

The following example illustrates a typical .wsh file:

[ScriptFile]
Path=C:\WINNT\Samples\WSH\showprop.vbs
[Options]
Timeout=0
DisplayLogo=1
BatchMode=0The path information in the [ScriptFile] section identifies the
script file that is associated with the .wsh file. The keys in the [Options]
section correspond to settings in the Script tab within the Properties
dialog box.

Note You must have the original script file present when executing the
.wsh file. If the .wsh file fails to run the script, check the Path=
information in the .wsh file to ensure that it points to the script you are
attempting to run.
---

Joe Earnest


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.521 / Virus Database: 319 - Release Date: 09-23-03


Geoff Hart

unread,
Dec 18, 2003, 5:47:14 PM12/18/03
to
Try the following:

c:\runas.exe /user:domain/user "wscript.exe
\"c:\\myscripts\\dosomething.wsf\""

I think this will do what you want.


"sasa" <sa...@tr.ca> wrote in message
news:OXbbnVNx...@tk2msftngp13.phx.gbl...

Al Dunbar [MS-MVP]

unread,
Dec 19, 2003, 11:15:18 PM12/19/03
to
In fact, there is such a thing as a .WSH file. If you right-click a .wsf or
.vbs file, select properties, then the script tab and modify anything, the
results are saved in a similarly named .WSH file, here is a sample:

[ScriptFile]
Path=C:\Documents and Settings\Al\Desktop\zzz.wsf
[Options]
Timeout=3
DisplayLogo=1

More helpful would be to ask what kind of wsh file the OP is planning to use
(.wsf, .vbs, .js, or?). Assuming vbscript of some sort, the answer is the
.run method of the wscript.shell object.

/Al

"Jason" <anon...@discussions.microsoft.com> wrote in message
news:001701c3c4ed$a55c03b0$a401...@phx.gbl...

0 new messages