![]() |
China DOS Union-- Unite DOS · Advance DOS · Grow DOS --Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum |
| Guest | Log in | Register | Members | Search | China DOS Union |
|
中国DOS联盟论坛 The time now is 2026-08-05 18:36 |
48,039 topics / 350,124 posts / today 2 new / 48,251 members |
| DOS批处理 & 脚本技术(批处理室) » Question: how to use variables as command parameters |
| Printable Version 728 / 2 |
| Floor1 ljamin | Posted 2007-09-02 19:31 |
| 新手上路 Posts 4 Credits 15 From 江西 | |
|
I have a program on hand right now that I need to run with parameters, but I want to make the parameter (or part of the parameter) be read from a variable.. I don't know how to do that.. what format should be used..
For example copy variable\filename variable That is to say, I want to use a variable as the parameter after the command.. or as part of the parameter... |
|
| Floor2 slore | Posted 2007-09-02 19:45 |
| 铂金会员 Posts 2,478 Credits 5,212 | |
|
In BAT you can use variables assigned with the SET statement
|
|
| Floor3 junchen2 | Posted 2007-09-02 20:25 |
| 高级用户 Posts 219 Credits 537 From 杭州--半山 | |
|
for /f %%a in ('dir d:\*.exe /s /b /a-d') do copy %%a foldername\%%a
|
|
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |