Search found 40 matches

by jaffamuffin
07 Apr 2008 17:51
Forum: DOS Batch Forum
Topic: Affect the result of a command in a variable
Replies: 1
Views: 3777

Is the out put of that command one-line or multiline? for /f "delims=" %%a in ('DIR /A-D /B %PACKERINPUTPATH%') do set MYFILES=%%a will work for a one liner not sure about multi. If it's a dir listing with mutli lines, usually best to write to a temp file like DIR /A-D /B %PACKERIN...
by jaffamuffin
07 Apr 2008 17:36
Forum: DOS Batch Forum
Topic: What is dropped on this batch: file or folder? (a solution)
Replies: 2
Views: 4276

Looks good. Have a play about with this and see if you get something you like?: Drag and drop a file or dir to see. ECHO FILE ATTRIBUTES echo %~a1 PAUSE This could be useful for something I'm working on. This reads in a drag and dropped bunch of image files (e.g. dsc_0411.tif) and sorts them into an...
by jaffamuffin
07 Apr 2008 17:21
Forum: DOS Batch Forum
Topic: Incremental count in a FOR loop
Replies: 4
Views: 6814

Looks like part of a nested for loop? To get variables to evaluate inside a for loop you need to enable delayed expansion and use ! instead of % to indicate the variable to expand when the interpreter gets to it, rather than at the opening of the for statement. Try something like this. SETLOCAL ENAB...
by jaffamuffin
15 Mar 2008 20:16
Forum: DOS Batch Forum
Topic: Batch file with variables
Replies: 4
Views: 6460

try

echo F | XCOPY "C:\Test\Image *.jpg" "C:\Imaged\TEST.jpg /y
by jaffamuffin
01 Feb 2008 15:48
Forum: DOS Batch Forum
Topic: DOS Batch / XP Command prompt file rename to remove spaces.
Replies: 10
Views: 14173

Yep, well done Didn't know about using the double quotes to eliminate the caret before the pipe. Does this technique require the use of "delims=" ? I took this and changed it into a bit more flexible will take search and replace params and will do files, dirs or both. @echo off REM %4- PAT...
by jaffamuffin
31 Jan 2008 18:17
Forum: DOS Batch Forum
Topic: DOS Batch / XP Command prompt file rename to remove spaces.
Replies: 10
Views: 14173

Thanks! Unfortunately though, that runs into similar problems, 1. It starts to rename the top level dirs before the subdirs. Once it does this it can't find the subdirs and errors. 2. the REN command is too weak for this, you can't rename a file including path to another file including path.(or can ...
by jaffamuffin
28 Jan 2008 12:56
Forum: DOS Batch Forum
Topic: How was I called?
Replies: 6
Views: 7793

You could start the 2nd batch in the first batch like this:

SET called=1
call 2ndbatch.baT




2ndbatch.bat
IF called=1 then bleh
otherwise it was ran from the cmd prompt.

Last line in 2ndbatch:

set called=0
by jaffamuffin
25 Jan 2008 14:57
Forum: DOS Batch Forum
Topic: How to Open a word document and close it using Batch file.
Replies: 1
Views: 4919

pstool / psexec to kill the process.?

Or use 'the logic' in Word to also close word when done?

Some kind of dll hook perhaps? (think about when you print a word doc from the right click menu?)
by jaffamuffin
25 Jan 2008 14:28
Forum: DOS Batch Forum
Topic: Checking Command Line Parameters in WINXP Batch
Replies: 0
Views: 5237

Checking Command Line Parameters in WINXP Batch

Hi all Just wrote this batch file to check the command line params in a batch file I'm working on. Posting here as a referance and in case it is useful for others. Or can anyone improve on it? If anyone has any feedback that would be nice cheers. @echo off SETLOCAL ENABLEEXTENSIONS SETLOCAL ENABLEDE...
by jaffamuffin
25 Jan 2008 14:23
Forum: DOS Batch Forum
Topic: DOS Batch / XP Command prompt file rename to remove spaces.
Replies: 10
Views: 14173

DOS Batch / XP Command prompt file rename to remove spaces.

Hi all Does anyone have a script or algorithm for searching through a directory tree of files and renaming any that have spaces in the file names and directory names? e.g. to have a _ instead of a space. Most files won't have a space. The code below does it but it's not great and it's slow (when you...