Wildcard on Folder Name

  • Thread starter Thread starter Shaun
  • Start date Start date
S

Shaun

Hi,

I am trying to use XCOPY to copy folder names that begin and end in a curly
brace and have 36 characters between them. The problem I have found is that
wildcards can only be used for files not folders, can anyone suggest an
alternative?

Thanks for your advice.
 
Shaun said:
Hi,

I am trying to use XCOPY to copy folder names that begin and end in a curly
brace and have 36 characters between them. The problem I have found is that
wildcards can only be used for files not folders, can anyone suggest an
alternative?

Thanks for your advice.

Wildcards can be used for folders too:

for /d %a in ({*.*) do xcopy "%a" "d:\%a\"
 
Pegasus (MVP) said:
Wildcards can be used for folders too:

for /d %a in ({*.*) do xcopy "%a" "d:\%a\"

Thanks for your reply, I can get it to work in dos, but when I try to put
the function in a .bat file to run I get an error:

C:\Home\a\b\ab>for /d %a in ({*}) do xcopy "%a" "C:\Home\a\b\tmp\%a\" /E

C:\Home\a\b\ab>xcopy "{00B6CEAE-39D7-453E-8D83-E151F6B52F96}"
"C:\Home\a\b\tmp\{
00B6CEAE-39D7-453E-8D83-E151F6B52F96}\" /E
{00B6CEAE-39D7-453E-8D83-E151F6B52F96}\images\web\additional1.jpg
{00B6CEAE-39D7-453E-8D83-E151F6B52F96}\images\web\main.jpg
{00B6CEAE-39D7-453E-8D83-E151F6B52F96}\images\web\thumbnail.jpg
3 File(s) copied

C:\Home\a\b\ab>imagecopy.bat
a" "C:\Home\a\b\tmp\a\" was unexpected at this time.

C:\Home\a\b\ab>for /d a" "C:\Home\a\b\tmp\a\"

C:\Home\a\b\ab>

Is there a different syntax when running commands from a file rather than
from the command prompt?
 
A good place to ask this would be over on usenet at
alt.msdos.batch.nt. Some of those guys are a real whiz at it.

HTH
Pop
 
Shaun said:
Thanks for your reply, I can get it to work in dos, but when I try to put
the function in a .bat file to run I get an error:

C:\Home\a\b\ab>for /d %a in ({*}) do xcopy "%a" "C:\Home\a\b\tmp\%a\" /E

C:\Home\a\b\ab>xcopy "{00B6CEAE-39D7-453E-8D83-E151F6B52F96}"
"C:\Home\a\b\tmp\{
00B6CEAE-39D7-453E-8D83-E151F6B52F96}\" /E
{00B6CEAE-39D7-453E-8D83-E151F6B52F96}\images\web\additional1.jpg
{00B6CEAE-39D7-453E-8D83-E151F6B52F96}\images\web\main.jpg
{00B6CEAE-39D7-453E-8D83-E151F6B52F96}\images\web\thumbnail.jpg
3 File(s) copied

C:\Home\a\b\ab>imagecopy.bat
a" "C:\Home\a\b\tmp\a\" was unexpected at this time.

C:\Home\a\b\ab>for /d a" "C:\Home\a\b\tmp\a\"

C:\Home\a\b\ab>

Is there a different syntax when running commands from a file rather than
from the command prompt?

In a batch file you must use this syntax:

@echo off
for /d %%a in ({*}) do xcopy "%%a" "C:\Home\a\b\tmp\%%a\" /E

You wrote: "Thanks for your reply, I can get it to work in dos". As
I said: This is not DOS - it is the Command Prompt. There is simply
no DOS under WinXP.
 
....
In a batch file you must use this syntax:

@echo off
for /d %%a in ({*}) do xcopy "%%a" "C:\Home\a\b\tmp\%%a\" /E

You wrote: "Thanks for your reply, I can get it to work in
dos". As
I said: This is not DOS - it is the Command Prompt. There is
simply
no DOS under WinXP.

You would do well to get off the "no DOS" crap all the time since
even MS calls them DOS commands. What you mean is, there is no
MSDOS, but even that's unnecessary to be pointing out when almost
anyone who does any research on their own are going to thing
you're a real dummy until they get to the right part of the
Command Prompt information. There most certainly IS a Disk
Operating System, otherwise there would be no disk operations.
Unless you just like to appear arrogant, or show off how
techinickel you are, instead point them to places, or describe
things, that make sense to the new posters and those new to XP et
al. What you do, and I've seen others do, is basically lying by
omission. Many DOS commands, and many more added command prompt
commands comprise what most know, and refer to as, DOS commands.
Even if they want MSDOS, you still should be able to be savvy
enough to get off your high horse and act/instruct accordingly.
Or, shut your keyhole; It's silly to act like you do.

No, I don't intend to debate this with you or anyone else; I've
had my say, and put the prelim info out there for anyone who
needs and/or wants to check up on these things, and hopefully
made it clearer why some bozos are so pround of problaiming
"There is no DOS in XP". And, I know you know all this.

Microsoft Windows XP - Command-line reference A-Z
In addition to the tools installed with Windows XP, there are
over 40 support tools included on ... For more information about
changes to the functionality of MS-DOS commands, new command-line
tools ...

Microsoft Windows XP - MS-DOS subsystem commands
Other MS-DOS subsystem commands, such as share , perform
functions that are now inherent to Windows XP or the MS-DOS
subsystem. The commands are accepted to preserve compatibility
with existing files ...



How to start the Setup program from MS-DOS in Windows XP
How to start the Setup program from MS-DOS in Windows XP



Microsoft Windows XP - Dos
Specifies that the MS-DOS subsystem is to maintain a link to the
upper memory area (UMA) or is to load part of itself into the
high memory area (HMA).



Error message when you install or start an MS-DOS or 16-bit
Windows ...
If you try to start or install an MS-DOS-based or a 16-bit
Windows-based program on your Windows XP-based computer, you may
receive an error message that is similar to one of the following:
16-bit MS ...



Microsoft Windows XP - MS-DOS overview
MS-DOS, the acronym for Microsoft Disk Operating System, is an
operating system with a command-line ... Windows XP Professional
Product Documentation > Windows components



Microsoft Windows XP - New ways to do familiar tasks
Windows XP retains and enhances almost all MS-DOS functionality.
The following tables explain: Changes to the functionality of
MS-DOS commands. MS-DOS commands that are no longer available in
Windows ...



How to print to a network printer from an MS-DOS-based program in
....
Explains how to print by using a network printer from an
MS-DOS-based program in Windows XP.



Microsoft Windows XP - Set up two shortcuts for an MS-DOS program
Open My Computer Locate the MS-DOS-based program (.exe) file, the
program information file (.pif), or the shortcut you want to
change. Right-click the file and click Create Shortcut.



Microsoft Windows XP - Specify custom startup files for
MS-DOS-based ...
Please consult the documentation that came with the MS-DOS-based
program before performing this procedure. Open My Computer Locate
the MS-DOS-based program (.exe) file, the program information
file ...



Microsoft Windows XP - Reserve shortcut keys for MS-DOS-based
programs
Open My Computer Locate the MS-DOS-based program (.exe) file, the
program information file (.pif), or shortcut you want to change.
Right-click the file, and then click Properties.



Microsoft Windows XP - Allocate system resources for an
MS-DOS-based ...
Open My Computer Locate the MS-DOS-based program (.exe) file, the
program information file (PIF), or shortcut you want to change.
Please refer to the documentation that came with the program for
the ...



How to use System files to create a boot disk to guard against
being ...
How to use System files to create a boot disk to guard against
being unable to start Windows XP ... This disk is different from
an MS-DOS startup disk. Unlike MS-DOS, the whole Windows
operating ...



Genuine Microsoft Software
Delight your friends and family with this fun, new way to
customize Windows XP. ... organized and efficient using advanced
tools to manage your e-mail, schedule, contacts, and to-dos.



Microsoft Windows XP - Display Help for an MS-DOS command
To display Help for an MS-DOS command ... 1. Open Command Prompt
2. At the command prompt, type the name of the command you want
help on ...



Microsoft Windows XP - Open an MS-DOS program from a command
prompt ...
Open Command Prompt Type the name of the installed MS-DOS-based
program you want to open, and then press ENTER. Or, change to the
directory where the program is located and type its name there



etc. etc. etc. etc. etc. etc., all at microsoft.com.



Pop




Pop
 
Thank you for your objective, non-emotional comments.
I am sure they will be of great help to the OP.
 
...

You would do well to get off the "no DOS" crap all the time since
even MS calls them DOS commands. What you mean is, there is no
MSDOS

Click Run.
In the Start, Run box, copy & paste the following: command /k ver and click OK.
You will see: MS-DOS Version 5.00.500
^^^^^^
 
Unk said:
Click Run.
In the Start, Run box, copy & paste the following: command /k ver and click OK.
You will see: MS-DOS Version 5.00.500
^^^^^^

Yep. It's the legacy command processor included with
Windows but it ain't DOS. Try running some typical DOS
commands, e.g.
- deltree
- fdisk
- sys

These are essential commands for DOS yet they are
not here!

Claiming that the DOS emulator under Windows is "DOS"
creates confusion among non-experts. The other day I answered
a post from someone who wanted to know what WinXP
permissions he had to set in order to run his DOS-based
partition table editor. He was quite upset at his inability to
do so. If he had known that the Command Prompt is only
an emulator but not the real thing then he would have saved
himself a lot of time and trouble.

Still, if it pleases you then feel free to call this emulator DOS.
Just make it clear when answering posts that there are a
great many DOS tasks that the emulator cannot perform.
 
Unk said:
Yep. It's the legacy command processor included with
Windows but it ain't DOS. Try running some typical DOS
commands, e.g.
- deltree
- fdisk
- sys

Just because they were left out, doesn't mean they won't work!
Copy "DELTREE.EXE" from a Win98's "C:\Windows\Command" folder to Win XP and it works just fine.

fdisk will return "Incorrect MS-DOS version", and sys works, but returns "Not able to SYS to
file system", only because I'm running NTFS. It works if XP's on FAT32

Try it yourself.
 
Unk said:
Just because they were left out, doesn't mean they won't work!
Copy "DELTREE.EXE" from a Win98's "C:\Windows\Command" folder to Win XP and it works just fine.

fdisk will return "Incorrect MS-DOS version", and sys works, but returns "Not able to SYS to
file system", only because I'm running NTFS. It works if XP's on FAT32

Try it yourself.

No, neither of them works. You obviously never tried them
for yourself. It is, of course, much easier to ask other people
to do the tests for you.

Note that there are several other essential DOS commands
that are equally unsupported when running a Command Prompt
under WinXP.

Now please run these tests yourself, then post the results
so that other readers can repeat your tests on their own PCs.
 
Unk said:
Just because they were left out, doesn't mean they won't work!
Copy "DELTREE.EXE" from a Win98's "C:\Windows\Command" folder to Win XP and it works just fine.

fdisk will return "Incorrect MS-DOS version", and sys works, but returns "Not able to SYS to
file system", only because I'm running NTFS. It works if XP's on FAT32

Try it yourself.

Perhaps I should point out a fundamental difference between
DOS and WinXP that you may not be aware of. DOS allows
programs to access the hardware directly. WinXP does not -
it uses the so-called Hardware Abstraction Layer (HAL) that
every program has to use if it wants to talk to the hardware.

Programs such as fdisk.com or sys.com need direct access to
your hard disk. Windows will never grant that access. You
may be able to overcome initial error messages such as "Wrong
DOS version" but you won't get much further. The same applies
to DOS-based partition table editors. It is impossible to run
them in a Command Prompt.

It is in areas like these where it becomes obvious that the
Command Prompt is just a DOS emulator. It is not the
real thing and it will never be. Still, if you want to call it
DOS then please do so.
 
Unk said:
No, neither of them works. You obviously never tried them
for yourself. It is, of course, much easier to ask other people
to do the tests for you.

I have tested it myself. Both work, or I wouldn't have posted it. I even keep deltree on a
thumb drive to use on corrupt Recycle Bins on customer's computers.
In fact, most non-MS-DOS-version-specific commands work.
You want me to post proof? Ok http://mypaidcall.com/secure/mydata/deltree.jpg

Like I said, just because they're unsupported doesn't mean they won't work.
 
Unk said:
I have tested it myself. Both work, or I wouldn't have posted it. I even keep deltree on a
thumb drive to use on corrupt Recycle Bins on customer's computers.
In fact, most non-MS-DOS-version-specific commands work.
You want me to post proof? Ok http://mypaidcall.com/secure/mydata/deltree.jpg

Like I said, just because they're unsupported doesn't mean they won't work.

I know that deltree works. It does because it does not access
the hard disk directly.

Please post a screen shot of you running sys.com and format.com
in a Command Prompt under WinXP. I'd love to see them.
 
I know that deltree works. It does because it does not access
the hard disk directly.

Please post a screen shot of you running sys.com and format.com
in a Command Prompt under WinXP. I'd love to see them.
You said that NEITHER of them work, now you say you know it works.
Format.com is MS-DOS version-specific and will not work.

This dialog is ended. Some people just can't, or won't see the light.
 
Unk said:
You said that NEITHER of them work, now you say you know it works.
Format.com is MS-DOS version-specific and will not work.

This dialog is ended. Some people just can't, or won't see the light.

Agreed. Happy living in pseudo-DOS land.

P.S. I never said that deltree does not work. I said that it does
not exist under WinXP.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top