Page 1 of 1 1
Topic Options
#14165 - 2001-11-12 11:15 AM Problem using external exe's
Anonymous
Unregistered


I want to execute the following code:

code:
$dir1 = '\\server\share'
$dir2 = '%userprofile%\dir'
Run "%comspec% /c xcopy $dir1 $dir2 /e /d /q /y"

When the run-line is executed there's an error stating "Invalid number of parameters".
The same problem occurs if I do this with the Shell-option.
If this is done via a shell to a batch-file, the xcopy-command (with the same parameters)executes without problems. What can this be? Isn't it possible to execute a 'dos'-exe with parameters from within Kix?

Top
#14166 - 2001-11-12 11:20 AM Re: Problem using external exe's
masken Offline
MM club member
*****

Registered: 2000-11-27
Posts: 1222
Loc: Gothenburg, Sweden
Have you tried:
code:

$dir1 = "\\server\share"
$dir2 = "%userprofile%\dir"
RUN '%COMSPEC% /C xcopy "$dir1" "$dir2" /e /d /q /y'


?
_________________________
The tart is out there

Top
#14167 - 2001-11-13 12:07 AM Re: Problem using external exe's
Anonymous
Unregistered


I'll tried it, but that's not (exactly) the solution. But with a little testing, I found the problem: It's the use of single and double quotes. The following is working:

code:
	$dir1 = '\\server\share' ;replced these quotes with single ones
$dir2 = '%userprofile%\dir' ;replced these quotes with single ones
Run '%comspec% /c xcopy "$dir1" "$dir2" /e /d /q /y'

Thanks for your help!

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Allen) and 581 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

Generated in 0.044 seconds in which 0.021 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org