home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 8 Other / 08-Other.zip / calmii30.zip / OPEN.BAT < prev    next >
DOS Batch File  |  1998-11-21  |  1KB  |  55 lines

  1. @echo off
  2. if "%TempScript%"=="" goto scripterr
  3. if "%1"=="" goto folder
  4. if "%1"=="/?" goto help
  5. direxist %1
  6. if errorlevel 1 goto folder
  7.  
  8. :start
  9. echo Start > %TempScript%
  10. cd >> %TempScript%
  11. echo %1 %2 %3 %4 %5 %6 %7 %8 %9 >> %TempScript%
  12. ren %TempScript% calmira.run
  13. goto end
  14.  
  15. :folder
  16. echo Folder > %TempScript%
  17. cd >> %TempScript%
  18. if "%1"=="" goto UseCurrentDir
  19. echo %1 >> %TempScript%
  20. goto Exec
  21.  
  22. :UseCurrentDir
  23. cd >> %TempScript%
  24.  
  25. :Exec
  26. ren %TempScript% calmira.run
  27. goto end
  28.  
  29.  
  30. :help
  31. echo.
  32. echo The OPEN command can start a program, open a document, or open
  33. echo a folder.  If no parameter is specified, the current directory 
  34. echo is opened.  You can omit the the full pathname of files and 
  35. echo folders that are in the current directory. 
  36. echo.
  37. echo Syntax:  OPEN filename [parameter1] [parameter2] ...
  38. echo          OPEN foldername
  39. echo          OPEN
  40. echo.
  41. echo Example: OPEN notepad c:\autoexec.bat /p
  42. echo          OPEN c:\windows
  43. goto end
  44.  
  45. :scripterr
  46. echo.
  47. echo There is no temporary script filename in the environment.
  48. echo You need to set the Tempscript environment variable to point
  49. echo to a suitable file.  See the Calmira help file topic on
  50. echo Using Script Files for more details.
  51.  
  52. :end
  53. echo.
  54.  
  55.