#126511 - 2004-09-10 03:34 PM
cannot import reg file using SU.exe, why???
|
expodium
Fresh Scripter
Registered: 2004-07-14
Posts: 35
|
hi all,
who can tell me why i cant import my reg file with SU.exe? The error result tell me it is succesfully but when i go see in the registry, i dont see the new key.
my script :
Break on
$SuUsername="userid" $SuPassword="password" RunSuAs("c:\winnt\system32\regedit.exe /s c:\1.reg") ? @SERROR
sleep 10 ;======================================================================================================================= Function RunSuAs($CommandLine) $Devpath="\ntreskit\Su.exe" If Exist($Devpath) SetL "SU_DOMAIN=FRITZEU" SetL "SU_PASSWORD=$SuPassword" SetL "SU_USERNAME=$SuUsername" SetL "SU_COMMANDLINE=$CommandLine" EndIf EndFunction
many many thanks in advance for who can help me
regards,
patrick
|
|
Top
|
|
|
|
#126513 - 2004-09-10 03:43 PM
Re: cannot import reg file using SU.exe, why???
|
expodium
Fresh Scripter
Registered: 2004-07-14
Posts: 35
|
i try to import a HKLM key
1.reg :
[HKEY_LOCAL_MACHINE\SOFTWARE\testenv] "test"=dword:00000000
i try to import this with a user logged on without admin rights but try to import it with su.exe.
The strange thing is that the error say "succesfully".
thanks for lokking to my problem.
Regards,
expodium
|
|
Top
|
|
|
|
#126515 - 2004-09-10 04:00 PM
Re: cannot import reg file using SU.exe, why???
|
expodium
Fresh Scripter
Registered: 2004-07-14
Posts: 35
|
yes, sorry for that. It have to be "c:\winnt\system32\su.exe"
but still, everithing the same. It give succesfully but dont see the new key in registry.
Regards,
Patrick
|
|
Top
|
|
|
|
#126516 - 2004-09-10 04:03 PM
Re: cannot import reg file using SU.exe, why???
|
expodium
Fresh Scripter
Registered: 2004-07-14
Posts: 35
|
i change the code so that he use SU.exe. (yeah, really something wrong with code today, its friday )
$Devpath="c:\winnt\system32\Su.exe"
$SuUsername="userid"
$SuPassword="password"
RunSuAs("$Devpath c:\winnt\system32\regedit.exe /s c:\1.reg")
? @SERROR
Sleep 10
;=======================================================================================================================
Function RunSuAs($CommandLine)
If Exist($Devpath)
SetL "SU_DOMAIN=FRITZEU"
SetL "SU_PASSWORD=$SuPassword"
SetL "SU_USERNAME=$SuUsername"
SetL "SU_COMMANDLINE=$CommandLine"
EndIf
EndFunction
regards,
Expodium
|
|
Top
|
|
|
|
#126518 - 2004-09-10 04:19 PM
Re: cannot import reg file using SU.exe, why???
|
expodium
Fresh Scripter
Registered: 2004-07-14
Posts: 35
|
i just added your line but still not working.
Is it possible that someone can give me a good example?
many thanks.
Regards,
Patrick
|
|
Top
|
|
|
|
#126521 - 2004-09-10 04:38 PM
Re: cannot import reg file using SU.exe, why???
|
expodium
Fresh Scripter
Registered: 2004-07-14
Posts: 35
|
sorry but dont understand what it mean with my script. Netdom is for adding or deleting members from the domain (workstations).
is it possible to give me a example with what i needed? importing the reg file.
many many thanks allready.
Regards,
Patrick
|
|
Top
|
|
|
|
#126523 - 2004-09-10 05:14 PM
Re: cannot import reg file using SU.exe, why???
|
expodium
Fresh Scripter
Registered: 2004-07-14
Posts: 35
|
i try this but it didnt work also. Thats the reason why asking for a example with the option i neede to add a reg file in to the registry.
But still, many thnaks.
Regards,
expodium
|
|
Top
|
|
|
|
#126524 - 2004-09-10 05:43 PM
Re: cannot import reg file using SU.exe, why???
|
expodium
Fresh Scripter
Registered: 2004-07-14
Posts: 35
|
when i try it, i get :
PrepareEnvironmentBlock error! (rc=203) The system could not find the environment option that was entered. CreateProcessAsUser error! (rc=2) The system cannot find the file specified
regards,
expodium
|
|
Top
|
|
|
|
#126526 - 2004-09-10 05:56 PM
Re: cannot import reg file using SU.exe, why???
|
expodium
Fresh Scripter
Registered: 2004-07-14
Posts: 35
|
SetL "SU_DOMAIN=FRITZEU" (im in a domain environment, FRITZEU) SetL "SU_PASSWORD=pws" Shell 'SU.EXE INSTALLER "c:\winnt\system32\regedit.exe /s c:\1.reg"'
userID is correct, pws is a dummy.
many thanks,
expodium
|
|
Top
|
|
|
|
#126527 - 2004-09-10 06:11 PM
Re: cannot import reg file using SU.exe, why???
|
expodium
Fresh Scripter
Registered: 2004-07-14
Posts: 35
|
i can use su.exe directly because path environment, or when i use c:\winnt\system32\su.exe, i get the same message.
regards,
expodium
|
|
Top
|
|
|
|
#126529 - 2004-09-10 10:33 PM
Re: cannot import reg file using SU.exe, why???
|
expodium
Fresh Scripter
Registered: 2004-07-14
Posts: 35
|
i heve now :
Break on
SetL "SU_PASSWORD=pws" CD "c:\ntreskit" Shell 'SU.EXE ADMINISTRATOR -e "c:\addreg2.exe"'
and still i get the error :
CreateProcessAsUser error! (rc=1780) A null reference pointer was passed to the stub.
I found on microsoft site a article about a fix. Its because a build problem but i install allready the suplemental version of resource kit server 2000.
i have version : 5.0.2128.1 (su.exe)
Other idea's?
regards,
expodium
|
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 874 anonymous users online.
|
|
|