General discussion

Locked

use wildcard to go to a directory

By dliby ·
I have user directories that name different on each computer. The directory is "xxxxxxxx.default"
Where the x's are random generated characters. I need to copy the same file to each of these directories. How can I use a wildcard in a batch file?

This conversation is currently closed to new comments.

2 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

by 3xp3rt In reply to use wildcard to go to a d ...

It's simple. Use it! For example ?copy something.txt c:\*.default\something.txt?

Collapse -

by 3xp3rt In reply to

Yes directly don't go but take a look about following screenshut


C:\Documents and Settings\sjosza\My Documents>copy test.txt c:\*.default\test.txt
The filename, directory name, or volume label syntax is incorrect.
0 file(s) copied.
C:\Documents and Settings\sjosza\My Documents>cd c:\*.default
C:\test1.default>

So you can use wildcharacters on cd command, your batch file mus be something like:

cd c:\*.default
copy c:\test.txt

Like on following screenshut


C>cd c:\*.default
C:\test1.default>copy c:\test.txt
1 file(s) copied.
C:\test1.default>


Good luck

Back to Windows Forum
2 total posts (Page 1 of 1)  

Related Discussions

Related Forums