#176138 - 2007-05-09 11:15 AM
Problem!!
|
roedie
Getting the hang of it
Registered: 2005-11-15
Posts: 52
Loc: balk friesland/holland
|
Hy all
I have a problem to run a kixtart script. The script has to add a folder and a DLL on the c:\progam files\infostrait\ directory.
But there is one problem! If i'm a normal user i can't create folders there, it needs administrator right's to do so.
Is there a simpel way to run around that? I need to run this script at the logon.
Here is a piece of the script i have now.
IF EXIST("c:\program files\infostrait\OutlookToSmarTeam\OutlookToSmarTeam.dll") GOTO MAPPING
else
CD "c:\program files\infostrait" md "OutlookToSmarTeam" copy "\\server\SmData\ClientSoftware\VB6\OutlookToSmarTeam" "c:\program files\infostrait\OutlookToSmarTeam" /s
cd "OutlookToSmarTeam" Shell "regsvr32 /s OutlookToSmarTeam.dll"
I hope you can help me out. (srry for my bad english)
|
Top
|
|
|
|
#176140 - 2007-05-09 11:47 AM
Re: Problem!!
[Re: Mart]
|
roedie
Getting the hang of it
Registered: 2005-11-15
Posts: 52
Loc: balk friesland/holland
|
Well i am a admin here.
The dll is for an application that allows useres to save emails in smarteam. but anyway i can't just type something like: runas user="admin" pass="xxxx" ???
|
Top
|
|
|
|
#176142 - 2007-05-09 12:20 PM
Re: Problem!!
[Re: Mart]
|
roedie
Getting the hang of it
Registered: 2005-11-15
Posts: 52
Loc: balk friesland/holland
|
I will try it in a couple of hours. I will let you know if it worked.
|
Top
|
|
|
|
#176145 - 2007-05-09 01:49 PM
Re: Problem!!
[Re: roedie]
|
Glenn Barnas
KiX Supporter
Registered: 2003-01-28
Posts: 4396
Loc: New Jersey
|
Unless I'm wrong, the XP Pro version of RUNAS won't accept a password as an argument - it must be entered interactively. Specifying the password directly after the user ID, as well as using "/PASS:xx" and "/PASSWORD:xx" switches fail. Even piping fails, as shown below.
PW1 - C:\Temp>echo PassWord | runas /user:domain\administrator cmd
Enter the password for domain\administrator:
Attempting to start cmd as user "gbcs\administrator" ...
RUNAS ERROR: Unable to run - cmd
1326: Logon failure: unknown user name or bad password.
I believe RUNnAS (double "n") is the form that will work, but you'll need to make it available to every system (via NetLogon share, possibly). It will also encode the password. It's an external tool you'll need to download.
Realize that there are tools to define and manage scheduled tasks, which can run as any user. The tcLib UDF library can create a task with specific credentials in as little as 4 lines of code, and then cause it to run immediatly. The CoDec UDF can obfuscate the account credentials stored in a file or even within the script, and these scripts should be tokenized to further hide the data and the methods of operation from casual users.
The latest tcLib can be downloaded from my web site, and CoDec is avaialble here on KORG, and in the KixDev package on my site.
Glenn
_________________________
Actually I am a Rocket Scientist!
|
Top
|
|
|
|
#176149 - 2007-05-09 03:03 PM
Re: Problem!!
[Re: Bryce]
|
roedie
Getting the hang of it
Registered: 2005-11-15
Posts: 52
Loc: balk friesland/holland
|
is there really not an otherway around? it's not like that i have to install a whole program. it's just for making a dir and copy one file into that dir. For the rest of the script it works fine.
|
Top
|
|
|
|
#176151 - 2007-05-09 03:09 PM
Re: Problem!!
[Re: Mart]
|
roedie
Getting the hang of it
Registered: 2005-11-15
Posts: 52
Loc: balk friesland/holland
|
It has to be done in the login script. Thats what the boss wants
*edit* post of the whole script */edit*
IF EXIST("c:\program files\infostrait\OutlookToSmarTeam\OutlookToSmarTeam.dll")
GOTO MAPPING
else
; --Hier maak je een een nieuwe map aan in de infostrait map. En er wordt een dll in de nieuwe map gekopieerd.
CD "c:\program files\infostrait"
md "OutlookToSmarTeam"
copy "\\serverxx\SmData\ClientSoftware\VB6\OutlookToSmarTeam" "c:\program files\infostrait\OutlookToSmarTeam" /s
; -- hier registreer je de dll.
cd "OutlookToSmarTeam"
Shell "regsvr32 /s OutlookToSmarTeam.dll"
; -- hier kopieer je 2 bestandjes voor de save in smarteam knop.
copy "\\serverxx\NETLOGON\Kixscripts\OLtoST\" "%userprofile%\Application Data\Microsoft\Outlook" /s
; -- hier zet je de macro security level in outlook op low
WriteValue("HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Outlook\Security\","Level","00000001","REG_DWORD")
; -- hier maak je een nieuwe map aan op de netwerk Y schijf.
CD "y:"
MD "outlookmsg"
:MAPPING
Edited by roedie (2007-05-09 03:14 PM)
|
Top
|
|
|
|
#176153 - 2007-05-09 03:27 PM
Re: Problem!!
[Re: Mart]
|
roedie
Getting the hang of it
Registered: 2005-11-15
Posts: 52
Loc: balk friesland/holland
|
so you say the best thing to do is to install it manualy on every pc with the admin acc?
|
Top
|
|
|
|
#176169 - 2007-05-10 08:53 AM
Re: Problem!!
[Re: Les]
|
roedie
Getting the hang of it
Registered: 2005-11-15
Posts: 52
Loc: balk friesland/holland
|
I think a startup script is not going to work becaus that the script is also making a folder on a network drive that is nessesary for the application to run.
i shall try to make an exe file. Maby that will do the trick.
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 557 anonymous users online.
|
|
|