PDA

View Full Version : Regedit and batch file



Xeno2002
11-05-2001, 08:24 PM
Hi There.
I have a problem. I need to run reg file from batch file at Windows NT. This seems not be a problem for me, however I have no idea how to obey this 'beautiful' Message Information with OK button in the middle after importing a reg file, which informs me that import was succesfull. Is there any possibility to run this from batch file without having such a message. I want to do it automatically without user interference.

Smitty
11-05-2001, 09:35 PM
Xeno2002

Use the /s switch..

Example from MSKB

The Regedit.exe utility is included with Windows NT Server 4.0. It can be run in silent mode by using the /S command-line option. A sample command line is:
REGEDIT /S C:\CERTSRV.REG

GL


Smitty

Xeno2002
11-05-2001, 10:39 PM
It Works fine. Thank You Smitty for quick Answer.

rezagh
11-10-2001, 02:16 PM
hi
I made some EXE files by BAT2EXE software and it works well.
But as you know better than me , this EXE file works when I have REG file which I made this EXE from it too.
Is there any procedure for making one EXE file form REG files(after openning notepad I can type:
regedit.exe /s Example.reg and save it to BAT file and by BAT2EXE software I can convert this BAT file to EXE file)
and this EXE file can works well by itself without having this REG file too?means I want to send only one EXE file toothers without sending REG file too beside it?
and finally is there any procedure for sending some files to other when I am chatting with them and it runs automatically while I am chatting with them?

Appreciate if you guide me.
Regards,

Novell2NT
02-07-2002, 03:02 AM
Is there a way to import a reg key and start an application without using a batchfile, that opens a DOS box.

Smitty
02-07-2002, 10:28 AM
Novell2NT

I am really not the guy to ask...but you could create your batchfile and then under Properties check Program tab, choose "Minimized" in Run options, and tick "Close on exit".

Very rudimentry sample below, runs regedit to import a reg key created with notepad, and runs Explorer.
------------------------------------------------
@ECHO OFF
CD\
regedit /s C:/giant.reg
cd windows
explorer.exe
exit
------------------------------------------------
Saved as test.bat. Runs without errors.

As I said this is not my "cup of tea" but rough as it is, it functions. Maybe one of the more astute DOS lads will jump in here and guide you further.

Good Luck


Smitty

Simon Clausen
02-07-2002, 10:55 AM
The other way would be to write a WSH script. From there you can read/write registry keys and also launch applications. Have a look at our <a target="_blank" href=http://www.winguides.com/scripting/>Scripting Guide</a> for more details.

The only catch is that not everyone has Windows Scripting enabled on their PC.

Regards,

Simon Clausen
---
WinGuides.com - Windows Guide Network
<a target="_blank" href=http://www.winguides.com/>http://www.winguides.com/</a>