Rob van der Woude's Scripting Pages
Powered by GeSHi

Source code for cdpclean.cmd

(view source code of cdpclean.cmd as plain text)

  1. /*
  2.  浜様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様�
  3.  � CDPclean:    Removes all IMMCDDiscResumePosition entries from CDP.INI     �
  4.  � Written by Rob van der Woude                                              �
  5.  � Latest revision:   1999/08/02                                             �
  6.  � This program is used to remove all IMMCDDiscResumePosition entries from   �
  7.  � CDP.INI, the INI file of OS/2's (MMOS2) audio CD player.                  �
  8.  � This prevent the CD player from starting somewhere in the middle of a     �
  9.  � song when you previously stopped the player at that point.                �
  10.  � Please feel free to use, distribute and modify this program.              �
  11.  � However, do so entirely at your own risk.                                 �
  12.  � The author cannot be held responsible for any damage or loss of data,     �
  13.  � caused by the use or inability to use this program.                       �
  14.  � If you modify this program, please document the modifications.            �
  15.  � I would also like to receive an e-mail message stating the nature of the  �
  16.  � modifications.                                                            �
  17.  藩様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様�
  18. */
  19.  
  20. /* Initialize RexxUtil */
  21. call RxFuncAdd "SysLoadFuncs", "RexxUtil", "SysLoadFuncs"
  22. call SysLoadFuncs
  23.  
  24. /* Find full path to MMOS2's CD Player's INI files */
  25. mmbase = value( "MMBASE", , "OS2ENVIRONMENT" )
  26. mmbase = strip( strip( mmbase, "T", ";" ), "T", "\" )
  27. cdpini = mmbase||"\CDP.INI"
  28.  
  29. /* Check if CDP.INI exists */
  30. call SysFileTree cdpini, "found.", "F", , "**---"
  31. if found.0 <> 1 then do
  32. 	call SysCls
  33. 	say ""
  34. 	call beep 880, 250
  35. 	say " ERROR: file "||cdpini||" not found."
  36. 	say ""
  37. 	exit
  38. end
  39.  
  40. /* Find IMMCDDiscResumePosition entries and remove them */
  41. call SysIni cdpini, "ALL:", "cdlist."
  42. do i=1 to cdlist.0
  43. 	call SysIni cdpini, cdlist.i, "ALL:", "cdlist."i"."
  44. 	drespos = SysIni( cdpini, cdlist.i, "IMMCDDiscResumePosition" )
  45. 	if drespos <> "ERROR:" then do
  46. 		call SysIni cdpini, cdlist.i, "IMMCDDiscResumePosition", "DELETE:"
  47. 		drespos = SysIni( cdpini, cdlist.i, "IMMCDDiscResumePosition" )
  48. 		if drespos <> "ERROR:" then do
  49. 			say "["||SysIni( cdpini, cdlist.i, "IMMCDDiscTitle" )||"]"
  50. 			say "Error removing IMMCDDiscResumePosition entry"
  51. 			say ""
  52. 		end
  53. 	end
  54. end
  55.  

page last modified: 2025-10-11; loaded in 0.0080 seconds