Advertisement
cjjmccray

my get_iplayer.cmd

Mar 26th, 2013
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 0.99 KB | None | 0 0
  1. @echo off
  2.  
  3. :Start
  4. rem Push the current directory onto a temporary variable using the
  5. rem pseudo-variable CD (requires command extensions to be enabled)
  6. set _curr_dir=%CD%
  7.  
  8. rem get_iplayer is a Win32 app, if running on 64-bit Windows it
  9. rem will have been installed in C:\Program Files (x86)\get_iplayer
  10. rem and if running on 32-bit Windows it will have been installed
  11. rem in C:\Program Files\get_iplayer
  12.  
  13. if "%ProgramFiles(x86)%"=="" goto ProgFiles
  14.  
  15. :x86pf
  16. rem We're running on 64-bit Windows
  17. rem Change drive and directories
  18. C:
  19. rem cd "\Program Files (x86)\get_iplayer"
  20. cd /d "%ProgramFiles(x86)%\get_iplayer"
  21. goto RunGetIPlayer
  22.  
  23.  
  24. :ProgFiles
  25. rem We're running on 32-bit Windows
  26. rem Change drive and directories
  27. C:
  28. cd /d "%ProgramFiles%\get_iplayer"
  29. goto RunGetIPlayer
  30.  
  31.  
  32. :RunGetIPlayer
  33. rem Run get_iplayer
  34. perl.exe get_iplayer.pl %*
  35.  
  36. :Return
  37. rem Pop the current directory back from a temporary variable
  38. cd /d %_curr_dir%
  39.  
  40. rem Clear the temporary variable
  41. set _curr_dir=
  42.  
  43. :End
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement