TheBlindHouse

Change Extension

Apr 29th, 2015
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. #Code for Self Script
  2. title Change File Extension
  3.  
  4. #added to allow for Run Script from within editor.
  5. if %1
  6. if @equal(@ext(%1),sns)
  7. shift
  8. end
  9. end
  10. ##################################################
  11. option fieldsep,"."
  12. if @not(%1)
  13. #needed to write changes to the registry
  14. %r = @regread(ROOT,*\shell\Change File Extension\Command)
  15. if @not(%r)
  16. if @ask(Add Change File Extension to context menu of files?)
  17. registry write,ROOT,*\shell\Change Extension\Command,,%0 @chr(34)"%1"@chr(34)
  18. if @ok()
  19. info Added to context menu.
  20. stop
  21. else
  22. warn Unable to add to contaxt menu. Try running as admin.
  23. stop
  24. end
  25. else
  26. stop
  27. end
  28. else
  29. if @not(@equal(%r,%0 @chr(34)%1@chr(34)))
  30. if @ask(Update Change File Extension path to current location?)
  31. registry write,ROOT,*\shell\Change Extension\Command,,%0 @chr(34)"%1"@chr(34)
  32. if @ok()
  33. info Path updated.
  34. stop
  35. else
  36. warn Unable to update path. Try running as admin.
  37. stop
  38. end
  39. else
  40. stop
  41. end
  42. end
  43. end
  44. warn Program is to be used via file context menu.
  45. stop
  46. end
  47.  
  48.  
  49. %t = @input(New File Extension:,@ext(%1))
  50. if @ok()
  51. if %t
  52. file rename,%1,@path(%1)\@name(%1).%t
  53. end
  54. end
  55. stop
Advertisement
Add Comment
Please, Sign In to add comment