Page 1 of 1 1
Topic Options
#71530 - 2002-11-11 05:00 PM Admin-rights with SU
Anonymous
Unregistered


I want to to run do the followig in a script with the Admin-rights. SU-Service ist installed on every Workstation. How can I do it?

$Central_LMHosts_File = "$KixServer\kixlogon\lmhosts.txt"
$LMHostfile = @lanroot + "\drivers\etc\lmhosts"

If NOT Exist ($LMHostfile)
Copy $Central_LMHosts_File $LMHostfile
Else
$FileStatus = CompareFileTimes ("$Central_LMHosts_File","$LMHostfile")
If $FileStatus > 0
SetFileAttr($LMHostfile, 0)
Copy $LMHostfile $BackupLMHostfile
Copy $Central_LMHosts_File $LMHostfile SetFileAttr($LMHostfile, $AttrFilename)
EndIf
EndIf

Top
#71531 - 2002-11-11 06:37 PM Re: Admin-rights with SU
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Please read ABC's of KiXtart board etiquette and message to new forum users , Installing an Application as an Admin , and Cannot find what you are looking for? .

Additionally search the KiXtart BBS for 'hosts copy' to find scripts that accomplish what you're trying to do. There will be 20+ results!

Finally, please post code between [CODE] tags, it looks neater.

Oh, and don't post a poll unless you're actually intend to do this.

[ 11. November 2002, 18:38: Message edited by: sealeopard ]
_________________________
There are two types of vessels, submarines and targets.

Top
Page 1 of 1 1


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 633 anonymous users online.
Newest Members
ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder, M_Moore
17887 Registered Users

Generated in 0.091 seconds in which 0.058 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org