Page 1 of 1 1
Topic Options
#118011 - 2004-04-15 03:51 PM Problem getting SHELL-command with quotes to work
Luziekix Offline
Getting the hang of it

Registered: 2003-02-27
Posts: 68
Hi,

sorry, but I´m tired of my unsuccessful trying ....

Problem:

I´ve tried to used Windows 2003 command-line-tool
DSADD.EXE to add an new user to the Active Directory (AD).

It works fine from a commandline or from a Batch-(-BAT)-File.

But including my commandline into KIX (I´m using v4.20 FINAL), I only get error-beeps all the time I´ve tried from the KIX32.EXE ....

I tried:

Code:
 $cmd="%comspec% /E:1024 /c DSADD.EXE user "CN=James Robert,CN=Users,DC=domain,DC=int""
SHELL $cmd



But this won´t work, and also:

Code:
 $cmd=´%comspec% /E:1024 /c DSADD.EXE user "CN=James Robert,CN=Users,DC=domain,DC=int"´
SHELL $cmd



won´t work.

It seems, tp be aan error with the single/double-quotes, but I can´t find out ...

Any help ?

Regards,

Luziekix

Top
#118012 - 2004-04-15 04:04 PM Re: Problem getting SHELL-command with quotes to work
AzzerShaw Offline
Seasoned Scripter
****

Registered: 2003-02-20
Posts: 510
Loc: Cheltenham, England
What happens if you try :


Code:
  
shell "cmd %comspec% /E:1024 /c DSADD.EXE user "CN=James Robert,CN=Users,DC=domain,DC=int""




_________________________
If at first you don't succeed, try again. Then quit. There's no use being a damn fool about it. - W.C Fields

Top
#118013 - 2004-04-15 04:07 PM Re: Problem getting SHELL-command with quotes to work
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Single outside, double inside... it's explained in the FAQ.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#118014 - 2004-04-15 05:04 PM Re: Problem getting SHELL-command with quotes to work
Luziekix Offline
Getting the hang of it

Registered: 2003-02-27
Posts: 68
@AzzerShaw:

with your line:

Code:
 shell "cmd %comspec% /E:1024 /c DSADD.EXE user "CN=James Robert,CN=Users,DC=domain,DC=int"" 



the DSADD.EXE-command waits there for input from the STDIN (=keyboard)

@Les:

I´ve tried:

Code:
 shell ´cmd %comspec% /E:1024 /c DSADD.EXE user "CN=James Robert,CN=Users,DC=domain,DC=int"´ 



but this gives me the following error:

ERROR : unknown command [%comspec%]!
Script: D:\Daten\TEST.KIX
Line : 0


Luziekix

Top
#118015 - 2004-04-15 05:07 PM Re: Problem getting SHELL-command with quotes to work
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Might try it without the cmd bit, because %comspec% is the cmd bit:

shell ´%comspec% /E:1024 /c DSADD.EXE user "CN=James Robert,CN=Users,DC=domain,DC=int"´

Top
#118016 - 2004-04-15 05:39 PM Re: Problem getting SHELL-command with quotes to work
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
The "curlies" strike again...

Code:

shell '%comspec% /E:1024 /c DSADD.EXE user "CN=James Robert,CN=Users,DC=domain,DC=int"'


Top
#118017 - 2004-04-15 05:51 PM Re: Problem getting SHELL-command with quotes to work
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
yesssss, could say that you were "caught by the short and curlies" ... but i wont say it.
Top
#118018 - 2004-04-15 06:51 PM Re: Problem getting SHELL-command with quotes to work
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
...there's a FAQ on that too.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#118019 - 2004-04-15 08:28 PM Re: Problem getting SHELL-command with quotes to work
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
Also just glancing at it...Shouldnt the CN=users be OU=users? Or does it matter?
Top
#118020 - 2004-04-16 09:15 AM Re: Problem getting SHELL-command with quotes to work
Luziekix Offline
Getting the hang of it

Registered: 2003-02-27
Posts: 68
> ... caught by the short and curlies" ...

OK,

I found my "starter-error" ;-)

I´ve used the false ´ instead of right '
so this causes my "Eror in expression".

Regards,

Luziekix


Top
#118021 - 2004-04-17 05:41 AM Re: Problem getting SHELL-command with quotes to work
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
See the FAQ Forum under Curly quotes “ and ”
_________________________
There are two types of vessels, submarines and targets.

Top
#118022 - 2004-06-16 06:14 PM Re: Problem getting SHELL-command with quotes to work
Udaloy Offline
Fresh Scripter

Registered: 2003-09-08
Posts: 31
Loc: Ohio
Ok, I'm having the same issue. I've read both faq's, and they don't seem to help. Here's my current version of code Code:
             $cmd = '%COMSPEC% /c "\\<server>\<share>\cscript service.vbs /M automatic /N W32Time /S "'+$pc
$x = Shell $cmd



I have tried it at least 10 different ways with no results.

Top
#118023 - 2004-06-16 06:31 PM Re: Problem getting SHELL-command with quotes to work
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Try it like this:

Shell $cmd

Top
#118024 - 2004-06-16 07:23 PM Re: Problem getting SHELL-command with quotes to work
Udaloy Offline
Fresh Scripter

Registered: 2003-09-08
Posts: 31
Loc: Ohio
That was it...
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 (Henriques) and 2516 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

Generated in 0.067 seconds in which 0.027 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