简体   繁体   中英

If command in bat file programming

I have a bat file.

If "%a%" == "value1" Set folder=folder_name

........ It is working fine.
Now my requirement is to add command to copy file from source to destination based on parameter. I passed it as (example)

IF "%a%" == "value" 
Copy xyz abc

Here a passed the value to parameter a and xyz is source path and ABC is destination path.

For this If command to copy file it gives the error like incorrect syntax.

Try This : IF [NOT] "string1"=="string2" Do Sth

For Example =

If Not "Yes"=="No" Echo Yes

More Info = if /?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM