Hello,
there is something wrong with the Script wizard:
When I have two files selected on Drive F: and add "G:\Programs\ExamDiff\ExamDiff.exe $A" to the Template box and press "Preview", I get:
G:\Programs\ExamDiff\ExamDiff.exe "F:\Test\Copy of Test.txt" F:\Test\Test.txt
...
That's OK (what's the reason for the ... ?), but the whole command will be executed twice.
When viewing the batch with "Edit", it becomes clear why:
@echo off
cd "F:\Test"
F:
G:\Programs\ExamDiff\ExamDiff.exe "F:\Test\Copy of Test.txt" F:\Test\Test.txt
G:\Programs\ExamDiff\ExamDiff.exe "F:\Test\Copy of Test.txt" F:\Test\Test.txt
The command was added twice.
The lines two and three are also in the wrong order, because you have to change the drive before you cd to another folder.
Using the whole command in the address bar works fine, btw.
Bye
Script wizard bug in 1.0.0.2
Moderators: fgagnon, nikos, Site Mods
-
- Site Admin
- Posts: 16295
- Joined: 2002 Feb 07, 15:57
- Location: UK
-
- Member
- Posts: 11
- Joined: 2004 Jul 18, 11:10
-
- Gold Member
- Posts: 560
- Joined: 2003 Jun 10, 23:19
- Location: NL
Well, 'wrong' is not the right word here, because it does work!! It seems more logical to first go to drive F: and then do the changeDir, but it is not required.rogers wrote:Mmff, OK, sorrynikos wrote:that's exactly what happens when you use tokens out of context
see tip # 108 in x2tips.rtf
But this order is wrong:
cd "F:\Test"
F:
CD changes the current folder on any drive. The command prompt doesn't actually have to be focused on that drive. So the sequence is quite valid.

In Win2000 and up, you can also do this in one step, like this:
Code: Select all
cd /d "F:\Test"
Quotes are optional here because there are no spaces in the path specification, but it's good pratice to use them always (especially in scripts where you can have a variable path to be CD'ed to

Note this won't work in Win9x (and ME I believe), because the '/d' parameter is not supported by the command processor of those Windows versions. [Edit:add]That is to say: command.com doesn't support this switch, but cmd.exe does

Last edited by JRz on 2004 Jul 19, 14:09, edited 1 time in total.
Dumb questions are the ones that are never asked 
