2007-04-06, 06:52 PM
Sub
Is it possible that you could update the parameters that are passed to recordingstatus.bat please.
Let me explain why. I used to parse %2 in a batch file using batch commands but since I added another tuner it became too complex and the batch commands are very limited, nothing to search a string with for example. I know I could write the string to a temp file and then "find" on the temp file but that's going a bit over the top and it gets messy.
Anyways, I decided to write a simple C# program to do what I need to do which I did very simply. My problem is when I pass the batch %2 as a parameter to my new program it gets messed up, I think because of the spaces and quotation marks.
Example 1
%2 = "0:Digital 1:Recording Coronation Street""1:Antenna:Sleeping""2:Cable:Recording Smallville"
My program gets = 0:Digital 1:Recording Coronation Street"1:Antenna:Sleeping2:Cable:Recording
Example 2
%2 = "0:Digital 1:Sleeping""1:Antenna:Sleeping""2:Cable:Recording Smallville"
My program gets = 0:Digital 1:Sleeping"1:Antenna:Sleeping
In the second example, the 3rd tuner gets missed off altogether.
If it's any help this is my recordingstatus.bat
@echo %DATE% %TIME% %* >> mystatus.log
@echo off
"C:\Program Files\devnz\console\Pundit_Lights.exe" 888 %1 %2 >> mystatus.log
and my 3 tuners are called "Digital 1", "Antenna" and "Cable"
Any help or reformatting of the paremeters would help
BTW, the overall objective being:
1. To turn on a green LED when any recording is going on.
2. To turn on a red LED when it is recording from Cable. This warns the familly to leave the cable box alone.
Cheers
Smeghead
Is it possible that you could update the parameters that are passed to recordingstatus.bat please.
Let me explain why. I used to parse %2 in a batch file using batch commands but since I added another tuner it became too complex and the batch commands are very limited, nothing to search a string with for example. I know I could write the string to a temp file and then "find" on the temp file but that's going a bit over the top and it gets messy.
Anyways, I decided to write a simple C# program to do what I need to do which I did very simply. My problem is when I pass the batch %2 as a parameter to my new program it gets messed up, I think because of the spaces and quotation marks.
Example 1
%2 = "0:Digital 1:Recording Coronation Street""1:Antenna:Sleeping""2:Cable:Recording Smallville"
My program gets = 0:Digital 1:Recording Coronation Street"1:Antenna:Sleeping2:Cable:Recording
Example 2
%2 = "0:Digital 1:Sleeping""1:Antenna:Sleeping""2:Cable:Recording Smallville"
My program gets = 0:Digital 1:Sleeping"1:Antenna:Sleeping
In the second example, the 3rd tuner gets missed off altogether.
If it's any help this is my recordingstatus.bat
@echo %DATE% %TIME% %* >> mystatus.log
@echo off
"C:\Program Files\devnz\console\Pundit_Lights.exe" 888 %1 %2 >> mystatus.log
and my 3 tuners are called "Digital 1", "Antenna" and "Cable"
Any help or reformatting of the paremeters would help
BTW, the overall objective being:
1. To turn on a green LED when any recording is going on.
2. To turn on a red LED when it is recording from Cable. This warns the familly to leave the cable box alone.
Cheers
Smeghead