Question
Script Help
I've modified M. Fischer's ptcstat script to work with my setup, however I'm looking to do something a lot simpler than that perl script. (The otcstat stuff used to be available on PTC's website, it's disappeared.)
As someone else suggested some time back, I copied the ptcstatus command and removed the more statement from it. I'm then calling that batch file to output the license usage
However after spending some time looking on line, I've hit a wall. Perhaps it's just brain fade on a Friday.
I have this command, that outputs the single line.
"C:\ptc\Creo 2.0\Parametric\bin\myptcstatus" | findstr /C:" PROE_Flex3C"
PROE_Flex3C 5 32
I can add >>flex3c.dat to the end to get it to write the output to a file. Great.
But, what I'd really like it to do is find the number in use, the second token, and then set a variable with that number so I can output both the date/time and the value to a line in the data file.
All the "for" syntax I've tried fails.
1st try:
for /F "tokens=2 usebackq" %A ("C:\ptc\Creo 2.0\Parametric\bin\myptcstatus" | findstr /C:" PROE_Flex3C")DO set FLEX3C=%A
("C:\ptc\Creo 2.0\Parametric\bin\myptcstatus" was unexpected at this time. <-- Error I get.
David Haigh
Phone: 925-424-3931
Fax: 925-423-7496
Lawrence Livermore National Lab
7000 East Ave, L-362
Livermore, CA 94550
This thread is inactive and closed by the PTC Community Management Team. If you would like to provide a reply and re-open this thread, please notify the moderator and reference the thread. You may also use "Start a topic" button to ask a new question. Please be sure to include what version of the PTC product you are using so another community member knowledgeable about your version may be able to assist.
As someone else suggested some time back, I copied the ptcstatus command and removed the more statement from it. I'm then calling that batch file to output the license usage
However after spending some time looking on line, I've hit a wall. Perhaps it's just brain fade on a Friday.
I have this command, that outputs the single line.
"C:\ptc\Creo 2.0\Parametric\bin\myptcstatus" | findstr /C:" PROE_Flex3C"
PROE_Flex3C 5 32
I can add >>flex3c.dat to the end to get it to write the output to a file. Great.
But, what I'd really like it to do is find the number in use, the second token, and then set a variable with that number so I can output both the date/time and the value to a line in the data file.
All the "for" syntax I've tried fails.
1st try:
for /F "tokens=2 usebackq" %A ("C:\ptc\Creo 2.0\Parametric\bin\myptcstatus" | findstr /C:" PROE_Flex3C")DO set FLEX3C=%A
("C:\ptc\Creo 2.0\Parametric\bin\myptcstatus" was unexpected at this time. <-- Error I get.
David Haigh
Phone: 925-424-3931
Fax: 925-423-7496
Lawrence Livermore National Lab
7000 East Ave, L-362
Livermore, CA 94550
This thread is inactive and closed by the PTC Community Management Team. If you would like to provide a reply and re-open this thread, please notify the moderator and reference the thread. You may also use "Start a topic" button to ask a new question. Please be sure to include what version of the PTC product you are using so another community member knowledgeable about your version may be able to assist.

