Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Code for Self Script
- title Change File Extension
- #added to allow for Run Script from within editor.
- if %1
- if @equal(@ext(%1),sns)
- shift
- end
- end
- ##################################################
- option fieldsep,"."
- if @not(%1)
- #needed to write changes to the registry
- %r = @regread(ROOT,*\shell\Change File Extension\Command)
- if @not(%r)
- if @ask(Add Change File Extension to context menu of files?)
- registry write,ROOT,*\shell\Change Extension\Command,,%0 @chr(34)"%1"@chr(34)
- if @ok()
- info Added to context menu.
- stop
- else
- warn Unable to add to contaxt menu. Try running as admin.
- stop
- end
- else
- stop
- end
- else
- if @not(@equal(%r,%0 @chr(34)%1@chr(34)))
- if @ask(Update Change File Extension path to current location?)
- registry write,ROOT,*\shell\Change Extension\Command,,%0 @chr(34)"%1"@chr(34)
- if @ok()
- info Path updated.
- stop
- else
- warn Unable to update path. Try running as admin.
- stop
- end
- else
- stop
- end
- end
- end
- warn Program is to be used via file context menu.
- stop
- end
- %t = @input(New File Extension:,@ext(%1))
- if @ok()
- if %t
- file rename,%1,@path(%1)\@name(%1).%t
- end
- end
- stop
Advertisement
Add Comment
Please, Sign In to add comment