By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,708 Members | 2,095 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,708 IT Pros & Developers. It's quick & easy.

Batch coding HELP!!!

P: 2
Dear Bytes Community,

First of all I would like to thank you in advance for helping me.

I have been trying to write a batch code that will:

1. Auto execute after POST.
2. Increment a value that is suppose to represent number of the POSTs.
3. Save, display the value and restart the PC.

I have tried to write one that access a txt file for the value; however the value does not increment.



Expand|Select|Wrap|Line Numbers
  1.  
  2.  
  3. @echo off
  4.  
  5. echo.This script is counting the # of POSTs.
  6.  
  7. cd "C:\Users\HP-M6\Documents"
  8. for /f "tokens=* delims=" %%x in (TEST.txt)  do echo %%x
  9.  
  10. call:myPOSTTest
  11.  
  12. for /f "tokens=* delims=" %%x in (TEST.txt)  do echo %%x
  13.  
  14.  
  15. echo.&pause&goto:eof
  16.  
  17.  
  18. ::--------------------------------------------------------
  19. ::-- Function section starts below here
  20. ::--------------------------------------------------------
  21. -- 
  22. :myPOSTTest    - here starts my function identified by it's label
  23.  
  24.  
  25. cd "C:\Users\HP-M6\Documents"
  26.  
  27. for /f "tokens=* delims=" %%x in (TEST.txt) do (
  28.  
  29. set %x%+=1
  30.  
  31. )
  32.  
  33.  
  34. goto:eof
  35.  
  36.  
  37.  

And I have a txt file that has X=0 for the value.



Thank you again for your help and I can't wait to get this over with.

T.J. Parsa
Jan 13 '14 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.