Divi WordPress Theme

Topic: Pass an argument while calling Windows batch file  (Read 348 times)

Offline Chris

  • Junior Guru
  • **
  • Posts: 77
  • iTrader: +0/-0
    • View Profile
Pass an argument while calling Windows batch file
« on: October 30, 2019, 05:27:43 PM »
Hi,

I have created a batch file which performs certain task on conditions. But the conditions are being checked based on the argument we supply in a batch file. I am not sure how to pass arguments for Windows batch file and use them in conditions?

Thanks!
VPS Hosting - AccuWebHosting

Offline Kailash

  • Web Hosting Master
  • *****
  • Administrator
  • Posts: 652
  • iTrader: +153/-0
    • View Profile
Re: Pass an argument while calling Windows batch file
« Reply #1 on: October 30, 2019, 05:28:46 PM »
Passing an argument in a batch file is easy. For example, if your batch file name is myfile.bat and you want to pass some argument, you can execute following command:

myfile myargument

The value myargument will be stored in %1 and you can store in variable as follow:

set arg1=%1
Shopify Divi WordPress Theme
Tags: