#163316 - 2006-06-16 12:22 PM
Supress Output of an REG IMPORT-Command
|
Luziekix
Getting the hang of it
Registered: 2003-02-27
Posts: 68
|
Hi,
I want to use somewhat like this to import settings into the registry from a .REG-File on a Windows XP or Win2000-Client (with REG.EXE from XP):
Code:
$cmd="reg import \\DOMAIN-DC\NETLOGON\SET-ORIG.reg" SHELL $cmd
-> This displays me: "Command successfully".
If I want to surpress this message I can use on the Windows-CMD-Processor:
reg import reg import \\DOMAIN-DC\NETLOGON\SET-ORIG.reg > NUL This works fine.
But this in a KIX-Script WON´T work: Code:
$cmd="reg import \\DOMAIN-DC\NETLOGON\SET-ORIG.reg > NUL" SHELL $cmd
-> This displays me: "Error: To many commandline parameters".
I´ve tried several things like: Code:
$cmd='reg import \\DOMAIN-DC\NETLOGON\SET-ORIG.reg >NUL: 2>NUL:' SHELL $cmd
but this display also: "Error: To many commandline parameters".
Anyone having a tip how I can import from a .REG-File without having any message on the screen ?!
Regards,
Luziekix
|
|
Top
|
|
|
|
#163318 - 2006-06-16 12:55 PM
Re: Supress Output of an REG IMPORT-Command
|
Luziekix
Getting the hang of it
Registered: 2003-02-27
Posts: 68
|
> why don't you just use the commands within kix for adding keys/values?
Because .REG-Files are much easier to handle for me, as I will set a huge bunch of Registry Keys with them. Not only some single values.
Maybe someone has a clue for my situation :-)
Luziekix
|
|
Top
|
|
|
|
#163322 - 2006-06-16 01:29 PM
Re: Supress Output of an REG IMPORT-Command
|
Luziekix
Getting the hang of it
Registered: 2003-02-27
Posts: 68
|
@Björn:
> SHELL $cmd > NUL
This don´t work. No message but also imports nothing...
@Mart:
OK, I´ll try the UDF you suggested. Thanks !
Luziekix
|
|
Top
|
|
|
|
#163329 - 2006-06-21 10:14 AM
Re: Supress Output of an REG IMPORT-Command
|
Luziekix
Getting the hang of it
Registered: 2003-02-27
Posts: 68
|
Hi,
thank you all.
I now use REGEDIT /s which works fine, though it is undocumented (=not help when starting REGEDIT e.g. with /? ).
I´ve tried the UDF with KIX v4.51, I seems not to work, but maybe I´ve done something wrong, as I have yet no more experience with UDFs.
Only bad thing that REGEDITs Switch /s is only here since Windows XP, and not seem to work in Windows 2000 (?!).
Regards,
Luziekix
|
|
Top
|
|
|
|
#163330 - 2006-06-22 02:52 AM
Re: Supress Output of an REG IMPORT-Command
|
NTDOC
Administrator
   
Registered: 2000-07-28
Posts: 11629
Loc: CA
|
Well my guess is that you're not using it correctly.
Please check out the FAQ for using UDF scripts.
Regedit Command Line Switches http://winhlp.com/WxRegeditCommandLineSwitches.htm Code:
$Folder = '\\SERVER\NETLOGON\REGFILES\' $File = 'regimports.reg' SHELL '%WINDIR%\regedit.exe /S ' + $Folder+$File
|
|
Top
|
|
|
|
#163331 - 2006-06-23 06:31 AM
Re: Supress Output of an REG IMPORT-Command
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
Please also note this is covered in the FAQ: LOADKEY - Why doesn't it work
Kent
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 476 anonymous users online.
|
|
|