Government Security
Network Security Resources

Jump to content


Make Batch File Pull A Continuation From An Arguement Input?

windows beginner programming
  • Please log in to reply
1 reply to this topic

#1 Chaolis



  • Members
  • 7 posts

Posted 10 March 2014 - 11:47 AM

for example, if i wanted to shorten long functions such as 'taskkill /f /im processname.exe'


and i made a batch file named 'tk.bat' and placed it somewhere my environment variables would look such as c:\windows


how can i make it so if the batch file was written:


taskkill /f /im 


if i wanted to run it from run prompt 'tk skype.exe' so the final output would be taskkill /f /im skype.exe


im not sure how to make it pull what is typed after 'tk ' 


This is just an example, im trying to figure out how to place whatever is typed after batch name to be a continuation of the command in the batch file


hope this isnt written to confusingly.

#2 illwill



  • Sergeant Major
  • 570 posts

Posted 06 April 2014 - 12:32 PM


taskkill /f /im %1

Also tagged with one or more of these keywords: windows, beginner, programming