Hi,
because this is a tricky question I have finished the solution:
I have store the counter at HKLM\SOFTWARE\bob\count. Next I create the following batch. Attention! After "delims=" there is a tabulator and a space ("<tab> ").
You need the reg.exe from the ressource kit to read and wrote to the registry...
--------------------------
@echo off
REM get the value from the registry
for /f "tokens=1-3 delims= " %%a in ('reg.exe query HKEY_LOCAL_MACHINE\SOFTWAR
REM decrement the value
set /A counter=counter+1
REM store the new value to the registry
reg.exe update HKEY_LOCAL_MACHINE\SOFTWAR
REM a test
echo %counter%
pause
--------------------------
How about some points more :-)
Main Topics
Browse All Topics





by: cboPosted on 1999-10-26 at 06:42:46ID: 2159055
Hi,
I think this is a hard question for only 25 points :-)
Here are a batch who can add a value to a environment variable. For next 25 points I show you how to read a registry variable:
@echo off
set old=66 &REM oly the test value
set add=1 &REM the value to add
set /A new=old+%add% &REM the addition
echo %new% &REM the old value + add