Advertisement
Enderminecraft34

Custom CMD

Mar 24th, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.41 KB | None | 0 0
  1. # For Python 3.5.2
  2. from os import system, getcwd
  3. print("Microsoft Windows [Version 6.3.9600]\n(c) 2013 Microsoft Corporation. All right reserved.\n")
  4. system("title Command Prompt")
  5. directory = getcwd().split("\\")
  6. FinalDirectory = ""
  7. Cool = ""
  8. for i in directory:
  9.     if ":" in i:
  10.         drive = i
  11. while True:
  12.     FinalDirectory = "cd \""
  13.     Cool = ""
  14.     for i in directory:
  15.         if ":" in i:
  16.             FinalDirectory += drive
  17.             Cool += drive
  18.         else:
  19.             FinalDirectory += "\\" + i
  20.             Cool += "\\" + i
  21.     if FinalDirectory[-1] == ":":
  22.         FinalDirectory += "\\"
  23.     FinalDirectory += "\""
  24.     command = input(Cool + ">")
  25.     if command == "exit":
  26.         exit()
  27.     if command == "clear":
  28.         command = "cls"
  29.     if command[:3] == "cd ":
  30.         if command == "cd" or command == "cd ":
  31.             pass
  32.         else:
  33.             directory.append(command[3:])
  34.     if command == "cd.." and len(directory) != 1:
  35.         del directory[-1]
  36.         print("")
  37.     elif command == "cd..":
  38.         print("")
  39.     else:
  40.         print()
  41.         if len(command) <= 2 and command.endswith(":"):
  42.             del directory
  43.             directory = [command.upper(), ]
  44.             drive = command.upper()
  45.             print("")
  46.         else:
  47.             command = drive + " & " + FinalDirectory + " & " + command
  48.             system(command)
  49.             print("")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement