Search found 22 matches

by karaziki
16 May 2015 16:29
Forum: DOS Batch Forum
Topic: Spaces in filename causing trouble
Replies: 15
Views: 9267

Re: Spaces in filename causing trouble

This is the style you need:

Code: Select all

IF /i "%~n1"=="import" GOTO launchdirect


If it still fails then look at other similar lines and change them also.
by karaziki
15 May 2015 14:00
Forum: DOS Batch Forum
Topic: Spaces in filename causing trouble
Replies: 15
Views: 9267

Re: Spaces in filename causing trouble

Ok I found a way for now using as

Code: Select all

IF (%1)==(menu) (GOTO launchmenu)
solves problem. But still confused about why it doesn't accept filename. I'll be happy on any comments or suggestions to fix my mistakes.

All bests
by karaziki
15 May 2015 13:54
Forum: DOS Batch Forum
Topic: Spaces in filename causing trouble
Replies: 15
Views: 9267

Re: Spaces in filename causing trouble

This is complete code @ECHO OFF SET fpath=%CD% SET epath=%b2eprogrampathname% CD /D %epath% ATTRIB -S -R "%~f1" >NUL 2>NUL IF (%1)==() (GOTO launchdirect) ::IF (%~n1)==(menu) (GOTO launchmenu) IF NOT (%2)==() (GOTO extconvert) SET pldfile=.pld .dds FOR %%G in (%pldfile%) do IF /I (%~x1)==(...
by karaziki
15 May 2015 13:41
Forum: DOS Batch Forum
Topic: Spaces in filename causing trouble
Replies: 15
Views: 9267

Re: Spaces in filename causing trouble

Code updated regarding to your warning, thanks. Works as before but the second IF still causing terminate IF (%1)==() (GOTO launchdirect) ::IF (%~n1)==(menu) (GOTO launchmenu) IF NOT (%2)==() (GOTO extconvert) And yes exactly as you expressed. checking for menu is just a simple way to see menu. I al...
by karaziki
15 May 2015 12:19
Forum: DOS Batch Forum
Topic: Spaces in filename causing trouble
Replies: 15
Views: 9267

Re: Spaces in filename causing trouble

Well thank you made me realize that I'm looking for wrong place. This is the complete code, I just started and stuck @ECHO OFF SET fpath=%CD% SET epath=%b2eprogrampathname% CD /D %epath% ATTRIB -S -R "%~f1" >NUL 2>NUL IF (%1)==() GOTO launchdirect ELSE :: this line below causing the proble...
by karaziki
15 May 2015 08:42
Forum: DOS Batch Forum
Topic: Spaces in filename causing trouble
Replies: 15
Views: 9267

Re: Spaces in filename causing trouble

Sorry no :(
Due to nature of need, I'm dragging and dropping files on batch file. That avoids me to use quotes in %1
by karaziki
15 May 2015 08:17
Forum: DOS Batch Forum
Topic: Spaces in filename causing trouble
Replies: 15
Views: 9267

Re: Spaces in filename causing trouble

Squashman wrote:What are you passing in as %1?

Some test file like cad file 2.dwg

Note: Sorry I edit the question after I realize the space problem. But I think you already understand that problem is %1 part.
by karaziki
15 May 2015 08:06
Forum: DOS Batch Forum
Topic: Spaces in filename causing trouble
Replies: 15
Views: 9267

Spaces in filename causing trouble

Hi;

The code below works fine unless there is a space in filename. I also faced same before about numeric values (1 3 8) in filenames.

Code: Select all

SET cadfile=.dwg .dxf .dwf
FOR %%G in (%cadfile%) do IF /I (%~x1)==(%%~G) GOTO cadconvert

Does anyone knows how can I handle this?
by karaziki
13 Mar 2015 20:35
Forum: DOS Batch Forum
Topic: Using filename in variable
Replies: 2
Views: 2479

Re: Using filename in variable

Ah yess, thank you
It respond in echo as expected. Time to integrate.

All Bests
by karaziki
13 Mar 2015 19:45
Forum: DOS Batch Forum
Topic: Using filename in variable
Replies: 2
Views: 2479

Using filename in variable

I was thinking it will be easy but become a headache I'm trying to set a variable contains filename like; SET %~n1_var=(%~z1) or SET /a %~n1_var=(%~z1) But when it comes to call back, even I couldn't test is it set or not like; ECHO "%%~n1_var%" or ECHO "%~n1_var%" I tried many c...
by karaziki
14 Feb 2015 22:43
Forum: DOS Batch Forum
Topic: Process files one by one
Replies: 16
Views: 10597

Re: Process files one by one

What about this? Now I have a solution. Got the main code and just modified a bit for flexible usage on different paths etc. Tested and working. But I have no idea comparing to dbenhams code. Which is better etc??? Note that, simply adding %NUMBER_OF_PROCESSORS% variable makes this code flexible bet...
by karaziki
14 Feb 2015 22:30
Forum: DOS Batch Forum
Topic: Process files one by one
Replies: 16
Views: 10597

Re: Process files one by one

@foxidrive Thanks for your reply. Irfan view is a great piece of software for casual usage. But when it comes to professional design it's way of encoding and compressing can not satisfy you. @Squashman I've seen the solution of Dave Benham but my knowledge is not enough to adaptate it to my script. ...
by karaziki
14 Feb 2015 22:04
Forum: DOS Batch Forum
Topic: Process files one by one
Replies: 16
Views: 10597

Re: Process files one by one

Edit: Forget to reply, 4 instance is about performance. Programs doesn't have limitation on it. Actually best aproach is to follow number of cores. I'm using 8 but think 4 is good because of 2 software will run for each file. Hope to have it work. _________________________________________ While I st...
by karaziki
14 Feb 2015 21:20
Forum: DOS Batch Forum
Topic: Process files one by one
Replies: 16
Views: 10597

Re: Process files one by one

There is a reply out there I think following your last logic over lock files (I don't know how it works ??) But I think your way will be a bit different to handle priority of truepng after pngwolf order. What I see so far is, seems like you love to deal with batch stuff :) Anyway. And when it comes ...
by karaziki
14 Feb 2015 20:11
Forum: DOS Batch Forum
Topic: Process files one by one
Replies: 16
Views: 10597

Re: Process files one by one

Hell no, truepng is the most smart one I see so far. Works straight. By the way I always found this forum more comfortable. Why not to write just over here? And when it comes to reply; The standart way of executing can not help since; 1. The process time of truepng can be seconds to several minutes....