Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Vista General Discussion > Batch file help

Reply
Thread Tools Display Modes

Batch file help

 
 
frankzappa77
Guest
Posts: n/a

 
      12-14-2008

I want to add the following registry keys using a batch file. I don't
want the batch file to import the reg file, I want the batch file to add
the keys itself.
This is the content of the reg file:

Code:
--------------------
[HKEY_CURRENT_USER\Console\%SystemRoot%_system32_cm d.exe]
"ScreenColors"=dword:0000000a
"FaceName"="Lucida Console"
"FontSize"=dword:000d0000
"FontFamily"=dword:00000036
"FontWeight"=dword:00000190
--------------------
This is what I put in my reg file after reading the reg /? and reg add
/? page in cmd.

Code:
--------------------
reg add HKEY_CURRENT_USER\Console\%SystemRoot%_system32_cm d.exe /v ScreenColors /t REG_DWORD /d 0000000a /f
reg add HKEY_CURRENT_USER\Console\%SystemRoot%_system32_cm d.exe /v FaceName /t REG_SZ /d Lucida Console /f
reg add HKEY_CURRENT_USER\Console\%SystemRoot%_system32_cm d.exe /v FontSize /t REG_DWORD /d 000d0000 /f
reg add HKEY_CURRENT_USER\Console\%SystemRoot%_system32_cm d.exe /v FontFamily /t REG_DWORD /d 00000036 /f
reg add HKEY_CURRENT_USER\Console\%SystemRoot%_system32_cm d.exe /v FontWeight /t REG_DWORD /d 00000190 /f
--------------------
But I get 4 errors and only one of them gets added successfully.


--
frankzappa77
 
Reply With Quote
 
 
 
 
Zaphod Beeblebrox
Guest
Posts: n/a

 
      12-15-2008

"Dave-UK" <> wrote in message
news:U--...
> "frankzappa77" <> wrote in message
> news:...
>>
>> I want to add the following registry keys using a batch file. I don't
>> want the batch file to import the reg file, I want the batch file to
>> add
>> the keys itself.
>> This is the content of the reg file:
>>
>> Code:
>> --------------------
>> [HKEY_CURRENT_USER\Console\%SystemRoot%_system32_cm d.exe]
>> "ScreenColors"=dword:0000000a
>> "FaceName"="Lucida Console"
>> "FontSize"=dword:000d0000
>> "FontFamily"=dword:00000036
>> "FontWeight"=dword:00000190
>> --------------------
>> This is what I put in my reg file after reading the reg /? and reg
>> add
>> /? page in cmd.
>>
>> Code:
>> --------------------
>> reg add HKEY_CURRENT_USER\Console\%SystemRoot%_system32_cm d.exe /v
>> ScreenColors /t REG_DWORD /d 0000000a /f
>> reg add HKEY_CURRENT_USER\Console\%SystemRoot%_system32_cm d.exe /v
>> FaceName /t REG_SZ /d Lucida Console /f
>> reg add HKEY_CURRENT_USER\Console\%SystemRoot%_system32_cm d.exe /v
>> FontSize /t REG_DWORD /d 000d0000 /f
>> reg add HKEY_CURRENT_USER\Console\%SystemRoot%_system32_cm d.exe /v
>> FontFamily /t REG_DWORD /d 00000036 /f
>> reg add HKEY_CURRENT_USER\Console\%SystemRoot%_system32_cm d.exe /v
>> FontWeight /t REG_DWORD /d 00000190 /f
>> --------------------
>> But I get 4 errors and only one of them gets added successfully.
>>
>>
>> --
>> frankzappa77

>
>
> It looks like Lucinda Console needs to be in quotes and you have
> invalid numerical data in a couple of lines:
>
> Here's my run of your batch file:
> C:\Users\Admin\Desktop>reg add
> HKEY_CURRENT_USER\Console\C:\Windows_system32_cmd
> .exe /v ScreenColors /t REG_DWORD /d 0000000a /f
> ERROR: Invalid syntax. Specify valid numeric value for '/d'.
> Type "REG ADD /?" for usage.
>
> C:\Users\Admin\Desktop>reg add
> HKEY_CURRENT_USER\Console\C:\Windows_system32_cmd
> .exe /v FaceName /t REG_SZ /d "Lucida Console" /f
> The operation completed successfully.
>
> C:\Users\Admin\Desktop>reg add
> HKEY_CURRENT_USER\Console\C:\Windows_system32_cmd
> .exe /v FontSize /t REG_DWORD /d 000d0000 /f
> ERROR: Invalid syntax. Specify valid numeric value for '/d'.
> Type "REG ADD /?" for usage.
>
> C:\Users\Admin\Desktop>reg add
> HKEY_CURRENT_USER\Console\C:\Windows_system32_cmd
> .exe /v FontFamily /t REG_DWORD /d 00000036 /f
> The operation completed successfully.
>
> C:\Users\Admin\Desktop>reg add
> HKEY_CURRENT_USER\Console\C:\Windows_system32_cmd
> .exe /v FontWeight /t REG_DWORD /d 00000190 /f
> The operation completed successfully.
>
>


In the REG_DWORD statements, either prefix the hex numbers with 0x to
indicate they are in hex (e.g. 0x0000000a) or convert the hex numbers to
binary and it should take them (e.g. 0000000a becomes 10, 00000036
becomes 54, etc.)

Hope this helps!

--
Zaphod

No matter where you go, there you are!


 
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Batch File enemeth Windows Vista General Discussion 6 11-19-2008 06:59 PM
Batch file Bob Windows Vista General Discussion 2 01-20-2008 12:39 PM
Batch file Bob Windows Vista File Management 0 01-06-2008 07:39 PM
batch file calling exe file problem JPS Windows Vista Security 1 12-20-2007 12:18 AM
Need help with batch file n o s p a m p l e a s e Windows Vista General Discussion 11 10-14-2007 06:35 AM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59