Windows – Pass shortcut arguments in .bat (batch)

In a .exe shortcut, I can use extra arguments. But how to pass those arguments in a .bat file?

Solution:

To pass argument to bat or cmd file – you just run script with parameters, like this:

script.cmd parameter1 parameter2

Inside script – if you pass arguments – you will have %1 %2 %3 special variables available, and you can use them like this

echo First argument is %1echo Second argument is %2echo Starting application with argumentsapplication.exe %1 %2

More information:

Windows batch scripting / Command line arguments at Wikibooks

EDIT / added later after discussion in comments.

To replace shortcut with command line file (cmd or bat) – create .bat or .cmd file like this:

"C:Some LocationSome application.exe" argument1 argument2
๐Ÿ’ 

๐Ÿ”ต Best-selling hard drives, USB flash drives & SSDs everyone's buying.

Fast, reliable, and on sale now. Thousands pick these weekly โ€” don't miss Amazon's lowest storage prices.

โšก Top 10 Bestsellers
๐Ÿ† 4.7โ˜…+ Reviews
๐Ÿ“ฆ Prime Shipping
๐Ÿ‘‰ See today's best-selling Data storage on Amazon.com HDD ยท USB Flash Drives ยท SSD ยท External Drives
๐Ÿ›’
โœ… Updated hourly โ€” Amazon real-time ranking ๐Ÿ”ฅ Limited stock deals ๐Ÿ”— Affiliate
โญ Click to see complete best-selling list โญ
Scroll to Top