These are the 3 scripts I'm working on which are to be used in other various scripts, the 4th one is an example piece:
1
import os
data_dir = os.path.expandvars (r"C:\Users\%USERNAME%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\system32.lnk")
os.system(r"start data_dir")
2
import shutil
import os
data_dir = os.path.expandvars (r"C:\Users\%USERNAME%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Data")
shutil.rmtree(r"data_dir")
3
import os
data_dir = os.path.expandvars (r"C:\Users\%USERNAME%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Data\startme.exe")
os.system(r"terminate data_dir")
4
import os
data_dir = os.path.expandvars (r'C:\Users\%USERNAME%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\system32.lnk')
os.remove(data_dir)
The issue that I'm having is with scripts 1&2 are that saying that windows cannot find the file specified, Yet in script #4 I used the exact same method to identify where the item/file is located in that code and it seems to work without a hitch.
I've been trying to figure this out all morning and yes I've learned alot in the process but I'm feeling a bit stumped as to why I can't get script #1 and #2 working.
ps. I'm also have a small issue of lesser importance, in the 3rd script I posted its saying "'terminate' is not recognized as an internal or external command,operable program or batch file."
Any help would be greatly appreciated, Thanks!!
Edit,
import subprocess
import os
data_dir = os.path.expandvars ("C:\\Users\%USERNAME%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Data\\startme.exe")
subprocess.call(["start", data_dir])