Fri, Nov 15, 4:17 AM CST

Renderosity Forums / Poser - OFFICIAL



Welcome to the Poser - OFFICIAL Forum

Forum Coordinators: RedPhantom

Poser - OFFICIAL F.A.Q (Last Updated: 2024 Nov 15 4:06 am)



Subject: OT: Calling All MS-DOS Gurus


mathman ( ) posted Thu, 25 June 2009 at 11:42 AM · edited Thu, 25 July 2024 at 3:48 AM

All,

I am trying to run the following from the command prompt : 

XCOPY /C "F:Poser Runtimetextures!DREAMSQUARESDreamyRealisticEyesDRE_Bl
ack.jpg" "C:Program Filese frontierOther RuntimesMikiruntimetextures!DREA
MSQUARESDreamyRealisticEyesDRE_Black.jpg"

(sorry about the wrap-around).

When I run this, I get the error message "Invalid number of parameters".

Any ideas ?

thanks,
Andrew


ockham ( ) posted Thu, 25 June 2009 at 11:56 AM

I think the ! exclamation point is the problem.  DOS doesn't like most punctuation.
When I try it in a simpler situation (COPY "!poo" foo), it won't accept the ! even within quotes.

My python page
My ShareCG freebies


markschum ( ) posted Thu, 25 June 2009 at 12:04 PM

for a single file just use copy 

I am surprised it takes long file names

use help xcopy at the prompt for all the parameters


pjz99 ( ) posted Thu, 25 June 2009 at 12:16 PM

Yeah I think Ockham is correct about the "!" character.

My Freebies


IsaoShi ( ) posted Thu, 25 June 2009 at 12:50 PM · edited Thu, 25 June 2009 at 12:56 PM

Try substituting the exclamation mark in the target filename with: %21
That might work.

(edit) nah, I just tried it in a Windows 7 Command Prompt window -- it didn't.

"If I were a shadow, I know I wouldn't like to be half of what I should be."
Mr Otsuka, the old black tomcat in Kafka on the Shore (Haruki Murakami)


ockham ( ) posted Thu, 25 June 2009 at 1:11 PM

I'm curious as to why you need XCOPY anyway.  Can't you just use the drag-n-drop
in Explorer?

My python page
My ShareCG freebies


Jules53757 ( ) posted Thu, 25 June 2009 at 1:17 PM

2 questions, why with /c for only one file and why in quotation marks?


Ulli


"Never argue with an idiot. They drag you down to their level and beat you with experience!"


pjz99 ( ) posted Thu, 25 June 2009 at 1:26 PM

The quote marks are needed to force the command to interpret directory names containing a space character as a single string, otherwise it will consider a space to be the separator between parameters.  The /c switch is to suppress "confirmation" prompts when a copy hits a stumbling block (e.g. "overwrite yes/no" prompts").

My Freebies


pjz99 ( ) posted Thu, 25 June 2009 at 1:27 PM

Quote - I'm curious as to why you need XCOPY anyway.  Can't you just use the drag-n-drop
in Explorer?

Two words: batch files :)  As a script author this should have occurred to you.

My Freebies


CaptainJack1 ( ) posted Thu, 25 June 2009 at 1:34 PM

Is this actually MS-DOS, or a DOS prompt on Windows 95 or earlier, or is it the command prompt from a newer version of Windows?

Under DOS, the maximum length of a command was 128 characters, and your line is 199 characters long. If you're up against the 128 byte limit, the program is going to lose everything to the right of it (including the second quotation mark) and it will only see this:

XCOPY /C "F:Poser Runtimetextures!DREAMSQUARESDreamyRealisticEyesDRE_Black.jpg" "C:Program Filese frontierOther Runtime

which, to DOS, consists of four arguments plus the switch, which would explain the error.

There was a setting you could add to CONFIG.SYS to extend the length of the input line for COMMAND, but I'd have to look it up. I'm not sure what the restrictions (if any) are on CMD, the command interpreter that newer versions of Windows use.
 


pjz99 ( ) posted Thu, 25 June 2009 at 1:37 PM

That hadn't occurred to me.  There's another way to work around that by setting environment variables to contain the long strings and then referencing them by %NAME or something like that, but it's been a long time.

My Freebies


mathman ( ) posted Thu, 25 June 2009 at 4:05 PM

Thanks all for replying so far .....

As is often the case, I haven't explained myself properly. So allow me to clarify further : 

(1) The XCOPY above is merely a sample line from a batch file that I created using Excel. That batch file contains hundreds of these XCOPY commands.
(2) Not all of these contain the exclamation mark ('!')
(3) I can't simply drag'n'drop in Explorer because the source folder (F:..textures..) contains thousands of files of which I am copying a few hundred.
(4) I am running the batch file from within a cmd box invoked from the command line in Win XP.

regards,
Andrew


pjz99 ( ) posted Thu, 25 June 2009 at 4:34 PM · edited Thu, 25 June 2009 at 4:35 PM

Okay off the bat I get something different (XP 64):

C:Temp>xcopy /c "c:tempYay Bent.jpg" "c:temp!Yay Bent.jpg"
Does C:temp!Yay Bent.jpg specify a file name
or directory name on the target
(F = file, D = directory)?

not dependent on "!" character, I get the same with a different filename.

My Freebies


nruddock ( ) posted Thu, 25 June 2009 at 4:35 PM

According to the usage for xcopy the options come last :-
XCOPY source [destination] [/A | /M] [/D[:date]] [/P] [/S [/E]] [/V] [/W]
                           [/C] [/I] [/Q] [/F] [/L] [/G] [/H] [/R] [/T] [/U]
                           [/K] [/N] [/O] [/X] [/Y] [/-Y] [/Z]
                           [/EXCLUDE:file1[+file2][+file3]...]


pjz99 ( ) posted Thu, 25 June 2009 at 4:35 PM

I don't think the command is that picky about parameter order, I get the same result whether the /c is first or last.

My Freebies


mathman ( ) posted Thu, 25 June 2009 at 4:45 PM

pjz99 ... the destinations are files.


CaptainJack1 ( ) posted Thu, 25 June 2009 at 5:18 PM

Quote - (4) I am running the batch file from within a cmd box invoked from the command line in Win XP.

What's the exact command you're using to run the batch file? Are you selecting the command interpreter from the accessories menu, or are you starting it from the "Run" dialog?

I found out that Windows XP has both COMMAND.COM (the old DOS shell) as well as CMD.EXE (the interpreter originally invented for NT).

I can't find any kind of line length limitation for CMD.EXE, so I'm not sure that's it. I'd also be interested to know if any lines which are longer (and contain spaces in the file names) in the batch file are executing successfully.

Any chance you could post a screen shot of the command window showing the error?


pjz99 ( ) posted Thu, 25 June 2009 at 5:46 PM · edited Thu, 25 June 2009 at 5:47 PM

Quote - pjz99 ... the destinations are files.

Yes, I caught that, I'm saying my version of xcopy does not behave the same as yours (either I get prompted in that way, or it succeeds in copying).  I don't know what to tell you as to why yours is not working the same unless maybe you've installed a replacement xcopy, I know for sure mine is the Microsoft vanilla version.

If I remember correctly, "command.com" is provided only for 16-bit compatibility, and for any modern stuff you really ought to be using cmd.exe as your basic command interpreter.

My Freebies


mathman ( ) posted Thu, 25 June 2009 at 6:40 PM

To confirm, yes I am using CMD.EXE,  invoked from the Run dialog.
pjz - I have not replaced XCOPY.


pjz99 ( ) posted Thu, 25 June 2009 at 6:44 PM

Did this ever work in the past?  Has it stopped working recently?  What changed?  Are you able to just use the copy command instead of xcopy?

My Freebies


WandW ( ) posted Thu, 25 June 2009 at 6:58 PM

If the command line length is the problem,  the 'subst' command still works in XP, and may be useful, depending on your directory layout.  You can run it from a shell, or put it in autoexec.bat....

----------------------------------------------------------------------------------------

The Wisdom of bagginsbill:

"Oh - the manual says that? I have never read the manual - this must be why."
“I could buy better software, but then I'd have to be an artist and what's the point of that?"
"The [R'osity Forum Search] 'Default' label should actually say 'Don't Find What I'm Looking For'".
bagginsbill's Free Stuff... https://web.archive.org/web/20201010171535/https://sites.google.com/site/bagginsbill/Home


mathman ( ) posted Thu, 25 June 2009 at 7:31 PM

pjz99 i've only just started using XCOPY. I was having problems with COPY as well.


pjz99 ( ) posted Thu, 25 June 2009 at 8:28 PM

If copy AND xcopy are both giving you problems, I don't really know what to tell you other than to maybe look into some freeware alternative batch copying utility (or buy one if you care to spend money on it).  What exactly was the problem with the plain copy command?

My Freebies


mathman ( ) posted Fri, 26 June 2009 at 12:31 AM

Are there good freeware or open source batch copy utilities that you can recommend ? 


Khai-J-Bach ( ) posted Fri, 26 June 2009 at 12:32 AM

Attached Link: list of good copiers



pjz99 ( ) posted Fri, 26 June 2009 at 12:56 AM

I don't have any opinion myself, it's been many years now since I had occasion to use tools like that and I don't even remember names for the stuff any more :huh:  Hopefully Kaibach gets you squared away.

My Freebies


pakled ( ) posted Fri, 26 June 2009 at 3:56 PM

Did anyone notice the space between 'e' and 'frontier'? Dos interprets spaces as a break in whatever handle or argument you have. (at least older versions did)

I wish I'd said that.. The Staircase Wit

anahl nathrak uth vas betude doth yel dyenvey..;)


mathman ( ) posted Fri, 26 June 2009 at 5:57 PM · edited Fri, 26 June 2009 at 6:00 PM

All,

Problem solved. Here is an example of the correct format  : 

XCOPY /Y "F:Poser Runtime/Textures/RMKyonRMKI2.jpg" "C:Program Files/e frontier/Other Runtimes/Miki/runtime/Textures/RMKyon/"

I found out that XCOPY needs to know whether you are copying the file to another file or to a directory. To avoid any such ambiguity, you simply place the / character at the end of the destination's directory path, and leave out the destination file name.

The quotes are to cater for spaces that are embedded in the directory path. The /Y switch is to suppress any confirmation prompts - which is good news for batch files.

Thanks one and all for your help.

regards,
Andrew


pjz99 ( ) posted Fri, 26 June 2009 at 6:14 PM

Oh, glad it got sorted then.  Happy batching :)

My Freebies


AntoniaTiger ( ) posted Sun, 28 June 2009 at 2:34 AM

Ah, that brought back memories, though not useful ones. My batch code skills are pining for the fjords.

I have a DOS version of the awk utility somewhere, which I used to use for processing the lists of newsgroup names I got from my ISP's news server. Also a version of the gsort utility. But it's been quite a few years since I did anything complicated.

These days, people recommend Perl, and I recoil in horror. I shall have to look into Python: there are standalone versions as well as Poser's internal interpreter.


bantha ( ) posted Sun, 28 June 2009 at 3:29 AM

Quote -
These days, people recommend Perl, and I recoil in horror. I shall have to look into Python: there are standalone versions as well as Poser's internal interpreter.

I've looked into Python and liked it. They have so much stuff included, basic stuff seems to be quite easy. Give it a try, it works pretty well for me. 


A ship in port is safe; but that is not what ships are built for.
Sail out to sea and do new things.
-"Amazing Grace" Hopper

Avatar image of me done by Chidori


Privacy Notice

This site uses cookies to deliver the best experience. Our own cookies make user accounts and other features possible. Third-party cookies are used to display relevant ads and to analyze how Renderosity is used. By using our site, you acknowledge that you have read and understood our Terms of Service, including our Cookie Policy and our Privacy Policy.