so am trying to make python open cmd and navigate within the new folder with an argument form python.
i have a custom command in cmd to start det first batch file and the second argument i have the command is the name of the new folder.
create.bat
cd C:\Users\Eirik\Documents\MyProjects
python "C:\batch command\ACJ\create.py" %1
create.py
import sys
import subprocess
folderName = str(sys.argv[1])
def create():
if not os.path.exists(folderName):
os.mkdir(folderName)
print("Directory " , folderName, " Created ")
subprocess.call(["C:\\batch command\\nav.bat", folderName], shell=True )
else:
print("Directory " , folderName, "already exists, choose another name. ")
create()
nav.bat
cd C:Users\Eirik\Documents\MyProjects\%1