this program right now just takes a path and a key word you want and makes out the the text you would need to put in a .reg file to make a new run command shortcut.
in the future i want to put a gui to it and make it change the registry itself not just give you the text, but i have to read alot more for that.
I do need some help optimizing what i have though. Take note this is my first python program and i don't have all that much programing experance. heres what i have.
Code: Select all
#inputs
pathp = raw_input('Program Path: ')
namep = raw_input('Program Command: ')
#convert to list
pathp = list(pathp)
#make double slashes for registry format
slash1 = pathp.index('\\')
pathp.insert(slash1 , '\\')
if '\\' in pathp[slash1 + 1 :]: slash1 = slash1 + 2
if '\\' in pathp[slash1 :]: slash2 = pathp[slash1 :].index('\\')
if '\\' in pathp[slash1 :]: slash3 = slash2 + slash1
if '\\' in pathp[slash1 :]: pathp.insert(slash3 , '\\')
if '\\' in pathp[slash1 :]: slash1 = slash3
if '\\' in pathp[slash1 + 1 :]: slash1 = slash1 + 2
if '\\' in pathp[slash1 :]: slash2 = pathp[slash1 :].index('\\')
if '\\' in pathp[slash1 :]: slash3 = slash2 + slash1
if '\\' in pathp[slash1 :]: pathp.insert(slash3 , '\\')
if '\\' in pathp[slash1 :]: slash1 = slash3
if '\\' in pathp[slash1 + 1 :]: slash1 = slash1 + 2
if '\\' in pathp[slash1 :]: slash2 = pathp[slash1 :].index('\\')
if '\\' in pathp[slash1 :]: slash3 = slash2 + slash1
if '\\' in pathp[slash1 :]: pathp.insert(slash3 , '\\')
if '\\' in pathp[slash1 :]: slash1 = slash3
if '\\' in pathp[slash1 + 1 :]: slash1 = slash1 + 2
if '\\' in pathp[slash1 :]: slash2 = pathp[slash1 :].index('\\')
if '\\' in pathp[slash1 :]: slash3 = slash2 + slash1
if '\\' in pathp[slash1 :]: pathp.insert(slash3 , '\\')
if '\\' in pathp[slash1 :]: slash1 = slash3
if '\\' in pathp[slash1 + 1 :]: slash1 = slash1 + 2
if '\\' in pathp[slash1 :]: slash2 = pathp[slash1 :].index('\\')
if '\\' in pathp[slash1 :]: slash3 = slash2 + slash1
if '\\' in pathp[slash1 :]: pathp.insert(slash3 , '\\')
if '\\' in pathp[slash1 :]: slash1 = slash3
if '\\' in pathp[slash1 + 1 :]: slash1 = slash1 + 2
if '\\' in pathp[slash1 :]: slash2 = pathp[slash1 :].index('\\')
if '\\' in pathp[slash1 :]: slash3 = slash2 + slash1
if '\\' in pathp[slash1 :]: pathp.insert(slash3 , '\\')
if '\\' in pathp[slash1 :]: slash1 = slash3
if '\\' in pathp[slash1 + 1 :]: slash1 = slash1 + 2
if '\\' in pathp[slash1 :]: slash2 = pathp[slash1 :].index('\\')
if '\\' in pathp[slash1 :]: slash3 = slash2 + slash1
if '\\' in pathp[slash1 :]: pathp.insert(slash3 , '\\')
if '\\' in pathp[slash1 :]: slash1 = slash3
if '\\' in pathp[slash1 + 1 :]: slash1 = slash1 + 2
if '\\' in pathp[slash1 :]: slash2 = pathp[slash1 :].index('\\')
if '\\' in pathp[slash1 :]: slash3 = slash2 + slash1
if '\\' in pathp[slash1 :]: pathp.insert(slash3 , '\\')
if '\\' in pathp[slash1 :]: slash1 = slash3
if '\\' in pathp[slash1 + 1 :]: slash1 = slash1 + 2
if '\\' in pathp[slash1 :]: slash2 = pathp[slash1 :].index('\\')
if '\\' in pathp[slash1 :]: slash3 = slash2 + slash1
if '\\' in pathp[slash1 :]: pathp.insert(slash3 , '\\')
if '\\' in pathp[slash1 :]: slash1 = slash3
if '\\' in pathp[slash1 + 1 :]: slash1 = slash1 + 2
if '\\' in pathp[slash1 :]: slash2 = pathp[slash1 :].index('\\')
if '\\' in pathp[slash1 :]: slash3 = slash2 + slash1
if '\\' in pathp[slash1 :]: pathp.insert(slash3 , '\\')
if '\\' in pathp[slash1 :]: slash1 = slash3
if '\\' in pathp[slash1 + 1 :]: slash1 = slash1 + 2
if '\\' in pathp[slash1 :]: slash2 = pathp[slash1 :].index('\\')
if '\\' in pathp[slash1 :]: slash3 = slash2 + slash1
if '\\' in pathp[slash1 :]: pathp.insert(slash3 , '\\')
if '\\' in pathp[slash1 :]: slash1 = slash3
if '\\' in pathp[slash1 + 1 :]: slash1 = slash1 + 2
if '\\' in pathp[slash1 :]: slash2 = pathp[slash1 :].index('\\')
if '\\' in pathp[slash1 :]: slash3 = slash2 + slash1
if '\\' in pathp[slash1 :]: pathp.insert(slash3 , '\\')
if '\\' in pathp[slash1 :]: slash1 = slash3
if '\\' in pathp[slash1 + 1 :]: slash1 = slash1 + 2
if '\\' in pathp[slash1 :]: slash2 = pathp[slash1 :].index('\\')
if '\\' in pathp[slash1 :]: slash3 = slash2 + slash1
if '\\' in pathp[slash1 :]: pathp.insert(slash3 , '\\')
if '\\' in pathp[slash1 :]: slash1 = slash3
if '\\' in pathp[slash1 + 1 :]: slash1 = slash1 + 2
if '\\' in pathp[slash1 :]: slash2 = pathp[slash1 :].index('\\')
if '\\' in pathp[slash1 :]: slash3 = slash2 + slash1
if '\\' in pathp[slash1 :]: pathp.insert(slash3 , '\\')
if '\\' in pathp[slash1 :]: slash1 = slash3
if '\\' in pathp[slash1 + 1 :]: slash1 = slash1 + 2
if '\\' in pathp[slash1 :]: slash2 = pathp[slash1 :].index('\\')
if '\\' in pathp[slash1 :]: slash3 = slash2 + slash1
if '\\' in pathp[slash1 :]: pathp.insert(slash3 , '\\')
if '\\' in pathp[slash1 :]: slash1 = slash3
if '\\' in pathp[slash1 + 1 :]: slash1 = slash1 + 2
if '\\' in pathp[slash1 :]: slash2 = pathp[slash1 :].index('\\')
if '\\' in pathp[slash1 :]: slash3 = slash2 + slash1
if '\\' in pathp[slash1 :]: pathp.insert(slash3 , '\\')
if '\\' in pathp[slash1 :]: slash1 = slash3
if '\\' in pathp[slash1 + 1 :]: slash1 = slash1 + 2
if '\\' in pathp[slash1 :]: slash2 = pathp[slash1 :].index('\\')
if '\\' in pathp[slash1 :]: slash3 = slash2 + slash1
if '\\' in pathp[slash1 :]: pathp.insert(slash3 , '\\')
if '\\' in pathp[slash1 :]: slash1 = slash3
if '\\' in pathp[slash1 + 1 :]: slash1 = slash1 + 2
if '\\' in pathp[slash1 :]: slash2 = pathp[slash1 :].index('\\')
if '\\' in pathp[slash1 :]: slash3 = slash2 + slash1
if '\\' in pathp[slash1 :]: pathp.insert(slash3 , '\\')
if '\\' in pathp[slash1 :]: slash1 = slash3
if '\\' in pathp[slash1 + 1 :]: slash1 = slash1 + 2
if '\\' in pathp[slash1 :]: slash2 = pathp[slash1 :].index('\\')
if '\\' in pathp[slash1 :]: slash3 = slash2 + slash1
if '\\' in pathp[slash1 :]: pathp.insert(slash3 , '\\')
if '\\' in pathp[slash1 :]: slash1 = slash3
if '\\' in pathp[slash1 + 1 :]: slash1 = slash1 + 2
if '\\' in pathp[slash1 :]: slash2 = pathp[slash1 :].index('\\')
if '\\' in pathp[slash1 :]: slash3 = slash2 + slash1
if '\\' in pathp[slash1 :]: pathp.insert(slash3 , '\\')
if '\\' in pathp[slash1 :]: slash1 = slash3
if '\\' in pathp[slash1 + 1 :]: slash1 = slash1 + 2
if '\\' in pathp[slash1 :]: slash2 = pathp[slash1 :].index('\\')
if '\\' in pathp[slash1 :]: slash3 = slash2 + slash1
if '\\' in pathp[slash1 :]: pathp.insert(slash3 , '\\')
if '\\' in pathp[slash1 :]: slash1 = slash3
if '\\' in pathp[slash1 + 1 :]: slash1 = slash1 + 2
if '\\' in pathp[slash1 :]: slash2 = pathp[slash1 :].index('\\')
if '\\' in pathp[slash1 :]: slash3 = slash2 + slash1
if '\\' in pathp[slash1 :]: pathp.insert(slash3 , '\\')
if '\\' in pathp[slash1 :]: slash1 = slash3
if '\\' in pathp[slash1 + 1 :]: slash1 = slash1 + 2
if '\\' in pathp[slash1 :]: slash2 = pathp[slash1 :].index('\\')
if '\\' in pathp[slash1 :]: slash3 = slash2 + slash1
if '\\' in pathp[slash1 :]: pathp.insert(slash3 , '\\')
if '\\' in pathp[slash1 :]: slash1 = slash3
if '\\' in pathp[slash1 + 1 :]: slash1 = slash1 + 2
if '\\' in pathp[slash1 :]: slash2 = pathp[slash1 :].index('\\')
if '\\' in pathp[slash1 :]: slash3 = slash2 + slash1
if '\\' in pathp[slash1 :]: pathp.insert(slash3 , '\\')
if '\\' in pathp[slash1 :]: slash1 = slash3
if '\\' in pathp[slash1 + 1 :]: slash1 = slash1 + 2
if '\\' in pathp[slash1 :]: slash2 = pathp[slash1 :].index('\\')
if '\\' in pathp[slash1 :]: slash3 = slash2 + slash1
if '\\' in pathp[slash1 :]: pathp.insert(slash3 , '\\')
if '\\' in pathp[slash1 :]: slash1 = slash3
if '\\' in pathp[slash1 + 1 :]: slash1 = slash1 + 2
if '\\' in pathp[slash1 :]: slash2 = pathp[slash1 :].index('\\')
if '\\' in pathp[slash1 :]: slash3 = slash2 + slash1
if '\\' in pathp[slash1 :]: pathp.insert(slash3 , '\\')
if '\\' in pathp[slash1 :]: slash1 = slash3
if '\\' in pathp[slash1 + 1 :]: slash1 = slash1 + 2
if '\\' in pathp[slash1 :]: slash2 = pathp[slash1 :].index('\\')
if '\\' in pathp[slash1 :]: slash3 = slash2 + slash1
if '\\' in pathp[slash1 :]: pathp.insert(slash3 , '\\')
if '\\' in pathp[slash1 :]: slash1 = slash3
if '\\' in pathp[slash1 + 1 :]: slash1 = slash1 + 2
if '\\' in pathp[slash1 :]: slash2 = pathp[slash1 :].index('\\')
if '\\' in pathp[slash1 :]: slash3 = slash2 + slash1
if '\\' in pathp[slash1 :]: pathp.insert(slash3 , '\\')
if '\\' in pathp[slash1 :]: slash1 = slash3
if '\\' in pathp[slash1 + 1 :]: slash1 = slash1 + 2
if '\\' in pathp[slash1 :]: slash2 = pathp[slash1 :].index('\\')
if '\\' in pathp[slash1 :]: slash3 = slash2 + slash1
if '\\' in pathp[slash1 :]: pathp.insert(slash3 , '\\')
if '\\' in pathp[slash1 :]: slash1 = slash3
if '\\' in pathp[slash1 + 1 :]: slash1 = slash1 + 2
if '\\' in pathp[slash1 :]: slash2 = pathp[slash1 :].index('\\')
if '\\' in pathp[slash1 :]: slash3 = slash2 + slash1
if '\\' in pathp[slash1 :]: pathp.insert(slash3 , '\\')
if '\\' in pathp[slash1 :]: slash1 = slash3
#convert back to string
pathp = ''.join(pathp)
#output
print " "
print r"Windows Registry Editor Version 5.00"
print " "
print "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\" + namep + '.exe' + ']'
print '@="' + pathp + '"'
print ' '
input('press enter to end')
if everyone programed like this are computer world would be a mess.