Page 1 of 1 1
Topic Options
#183323 - 2007-12-06 03:23 AM Shell Help
MikeMarten Offline
Fresh Scripter

Registered: 2007-12-06
Posts: 8
I am just starting out with kix and I need some help with a shell function. I have tried this every way till sunday. I am trying to build the shell string first.

$ShellAd = "dsquery user -samid @USERID | dsget user -profile"
Shell $ShellAd

I can not get this to execute. Any idead?

Thank you in advance
Mike

Top
#183324 - 2007-12-06 03:36 AM Re: Shell Help [Re: MikeMarten]
Gargoyle Offline
MM club member
*****

Registered: 2004-03-09
Posts: 1597
Loc: Valley of the Sun (Arizona, US...
$rc = setoption(NoMacrosinStrings,ON)
$shellad ="dsquery user -samid "+@userid+" | sdget user -profile"
Shell $shellad
_________________________
Today is the tomorrow you worried about yesterday.

Top
#183325 - 2007-12-06 03:40 AM Re: Shell Help [Re: Gargoyle]
MikeMarten Offline
Fresh Scripter

Registered: 2007-12-06
Posts: 8
Thank you for the quick reply. Will try this in the morning when I get to work...

Mike

Top
#183327 - 2007-12-06 03:52 AM Re: Shell Help [Re: MikeMarten]
Allen Administrator Online   shocked
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4572
Loc: USA
I think the problem is with the pipe. You will need to invoke the cmd shell to make it work right.

 Code:
$ShellAd = '%comspec% /c dsquery user -samid ' +  @USERID + ' | dsget user -profile'
Shell $ShellAd


I've never used the ds_tools, but I would bet if you look in the UDF Forum, you will find a number of User Defined Functions already written that will do what you want without the need to shell out.
_________________________
(... better days ahead)

Top
#183345 - 2007-12-06 02:49 PM Re: Shell Help [Re: Allen]
MikeMarten Offline
Fresh Scripter

Registered: 2007-12-06
Posts: 8

Thank you Allen for the reply.. I knew it was the pipe but could not figure out how to get it working. Your solution is correct. I also got to looking at the UDF forum AFTER I wrote this.

Thanks again
MIke

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 1607 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.054 seconds in which 0.025 seconds were spent on a total of 13 queries. Zlib compression enabled.

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