0

So I want to create a custom command in command prompt. For example:

C:\Users\User> create Helloworld 

Where create will be the custom command which will run a batch script to run a python file and pass the string Helloworld to the python file.

I'm new to batch files. Any help is appreciated. Have a great and safe day! Thanks for reading!

asked Aug 30, 2020 at 12:37
2
  • Open a command prompt, run call /? and read the output help. So if you create, for example, in directory %SystemRoot% (C:\Windows in most cases) a batch file create.bat or create.cmd with, for example, @python.exe "C:\Full Path\ScriptFile.py" %*, then you have what you want. Commented Aug 30, 2020 at 13:03
  • I created a answer on something similar called please will see if I can do something for you like that. Commented Aug 30, 2020 at 15:27

1 Answer 1

1
@echo off
Call x:\path\yourPyBtachCaller.cmd "%*"

And place this create.cmd in any of the folders in your %PATH%

answered Sep 9, 2020 at 6:40
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.