Discussion Locked

use wildcard to go to a directory

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

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?

2 replies

by 3xp3rt

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

by 3xp3rt

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

This discussion is closed to new replies.