Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I would like to make a batch file to import one registry key. The only problem is that the key is different for each user. Here is the Key that I'm talking about.
[HKEY_CURRENT_USER\Software\Microsoft\Exchange\Messenger\Profiles\http://intranet/instmsg/aliases/ddrafts\Contacts]
In my case it is ddrafts for someone eles it would be their logon name.
Is their a way to do this??
Thanks
Doug

Is there any environment variable that holds that logon name, or perhaps any command taht will output it?
-- Leonardo Pignataro - Secret_Doom --
secret_doom@hotmail.com
www.batch.hpg.com.br

Leonardo,
I have figured it out. Thanks for you help. Here is how it looks just incase you were intrested.
@ECHO OFF
MD C:\REG:: CREATE MESSAGE .REG FILE
>"C:\REG\MESSAGE.REG" ECHO REGEDIT
>>"C:\REG\MESSAGE.REG" ECHO.
ECHO ADDING "Now adding Registry files" ENTRY
>>"C:\REG\MESSAGE.REG" ECHO [hkey_current_user\software\microsoft\exchange\messenger\profiles\http://intranet/instmsg/aliases/%username%\contacts]
>>"C:\REG\MESSAGE.REG" ECHO "test1@intranet"="test1@intranet"
>>"C:\REG\MESSAGE.REG" ECHO "test2@intranet"="test2@intranet"
>>"C:\REG\MESSAGE.REG" ECHO "test3@intranet"="test3@intranet"
>>"C:\REG\MESSAGE.REG" ECHO "test4@intranet"="test4@intranet"
>>"C:\REG\MESSAGE.REG" ECHO "test5@intranet"="test5@intranet"
>>"C:\REG\MESSAGE.REG" ECHO.
:: MERGE THE MESSAGE .REG FILE
:MERGE
START /WAIT REGEDIT /S "C:\REG\MESSAGE.REG":: DELETE THE MESSAGE .REG FILE
DEL "C:\REG\MESSAGE.REG"
RD C:\REG:: READY
GOTO END
:End
Now I need to figure out how to delete the key.Doug

![]() |
Net Send
|
MKDIR script help
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |