Answers for "prompt bat file"

5

get user input batch

rem rem is a comment line, NOT CODE, however it is a real batch command
rem The below line of code will ask the user a question.
rem Then, the input will be stored in a variable.
rem in this case, the variable is favcolor.

set /P favcolor="What is your favorite color?"

rem optional line of code to make use of the variable.

echo Wow, I like the color %favcolor% too!
Posted by: Guest on April-21-2020
0

how to run bat file without effect main code

import subprocess
from subprocess import Popen
import time
from multiprocessing import Process,freeze_support

def run_batfile(name='world'):
	subprocess.call(["launch_pg.bat"])

if __name__ == '__main__':
	# freeze_support()
	p = Process(target=run_batfile)
	p.start()
	# p.join()	
	count = 0
	while True:
		count+=1
		print(count)
		time.sleep(1)
Posted by: Guest on December-02-2020

Browse Popular Code Answers by Language