Adding a redirect to null in exec?

View: New views
4 Messages — Rating Filter:   Alert me  

Adding a redirect to null in exec?

by Steve Kapinos :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

When doing an exec task, how can I add a > nul at the end of the
command?

Trying to work around issues with psexec, they suggest piping the output
to Null.  But I can't seem to modify my task to get the desired effect.

The command I'm trying to incorporate is simply

Psexec.exe -accepteula \\10.0.27.142 -u administrator -p TANDBERG ping
127.0.0.1 > nul

Trying to put that into an exec task with arg line

        <target name="test" >
                <exec program="psexec" basedir="." workingdir=".">
                                <arg line="-accepteula"/>
                                <arg line="\\10.47.27.142"/>
                                <arg line="-u administrator"/>
                                <arg line="-p TANDBERG"/>
                                <arg line="ping 127.0.0.1"/>
                                <arg line="> nul"/>
                </exec>
        </target>

I get

     [exec]
     [exec] PsExec v1.94 - Execute processes remotely
     [exec] Copyright (C) 2001-2008 Mark Russinovich
     [exec] Sysinternals - www.sysinternals.com
     [exec]
     [exec] Bad parameter >.

Is there any way to add a pipe to the end of an exec statement like
this?  Only thing else I've considered is putting the command itself
into a batch file.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
NAnt-users mailing list
NAnt-users@...
https://lists.sourceforge.net/lists/listinfo/nant-users

Re: Adding a redirect to null in exec?

by Tony Selke-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

You need to encode the greater-than sign.  Try this:



        <target name="test" >
                <exec program="psexec" basedir="." workingdir=".">
                                <arg line="-accepteula"/>
                                <arg line="\\10.47.27.142"/>
                                <arg line="-u administrator"/>
                                <arg line="-p TANDBERG"/>
                                <arg line="ping 127.0.0.1"/>
                                <arg line="> nul"/>
                </exec>
        </target>


-----Original Message-----
From: nant-users-bounces@...
[mailto:nant-users-bounces@...] On Behalf Of Steve Kapinos
Sent: Monday, September 15, 2008 8:34 AM
To: nant
Subject: [NAnt-users] Adding a redirect to null in exec?

When doing an exec task, how can I add a > nul at the end of the
command?

Trying to work around issues with psexec, they suggest piping the output
to Null.  But I can't seem to modify my task to get the desired effect.

The command I'm trying to incorporate is simply

Psexec.exe -accepteula \\10.0.27.142 -u administrator -p TANDBERG ping
127.0.0.1 > nul

Trying to put that into an exec task with arg line

        <target name="test" >
                <exec program="psexec" basedir="." workingdir=".">
                                <arg line="-accepteula"/>
                                <arg line="\\10.47.27.142"/>
                                <arg line="-u administrator"/>
                                <arg line="-p TANDBERG"/>
                                <arg line="ping 127.0.0.1"/>
                                <arg line="> nul"/>
                </exec>
        </target>

I get

     [exec]
     [exec] PsExec v1.94 - Execute processes remotely
     [exec] Copyright (C) 2001-2008 Mark Russinovich
     [exec] Sysinternals - www.sysinternals.com
     [exec]
     [exec] Bad parameter >.

Is there any way to add a pipe to the end of an exec statement like
this?  Only thing else I've considered is putting the command itself
into a batch file.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great
prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
NAnt-users mailing list
NAnt-users@...
https://lists.sourceforge.net/lists/listinfo/nant-users


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
NAnt-users mailing list
NAnt-users@...
https://lists.sourceforge.net/lists/listinfo/nant-users

Re: Adding a redirect to null in exec?

by Roebuck, Alex :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Steve,

Use the escape sequence > in place of >.

e.g.:

 <arg line="> nul"/>

Regards,

Alex Roebuck.

-----Original Message-----
From: nant-users-bounces@...
[mailto:nant-users-bounces@...] On Behalf Of Steve
Kapinos
Sent: Monday, September 15, 2008 1:34 PM
To: nant
Subject: [NAnt-users] Adding a redirect to null in exec?

When doing an exec task, how can I add a > nul at the end of the
command?

Trying to work around issues with psexec, they suggest piping the output
to Null.  But I can't seem to modify my task to get the desired effect.

The command I'm trying to incorporate is simply

Psexec.exe -accepteula \\10.0.27.142 -u administrator -p TANDBERG ping
127.0.0.1 > nul

Trying to put that into an exec task with arg line

        <target name="test" >
                <exec program="psexec" basedir="." workingdir=".">
                                <arg line="-accepteula"/>
                                <arg line="\\10.47.27.142"/>
                                <arg line="-u administrator"/>
                                <arg line="-p TANDBERG"/>
                                <arg line="ping 127.0.0.1"/>
                                <arg line="> nul"/>
                </exec>
        </target>

I get

     [exec]
     [exec] PsExec v1.94 - Execute processes remotely
     [exec] Copyright (C) 2001-2008 Mark Russinovich
     [exec] Sysinternals - www.sysinternals.com
     [exec]
     [exec] Bad parameter >.

Is there any way to add a pipe to the end of an exec statement like
this?  Only thing else I've considered is putting the command itself
into a batch file.

------------------------------------------------------------------------
-
This SF.Net email is sponsored by the Moblin Your Move Developer's
challenge
Build the coolest Linux based applications with Moblin SDK & win great
prizes
Grand prize is a trip for two to an Open Source event anywhere in the
world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
NAnt-users mailing list
NAnt-users@...
https://lists.sourceforge.net/lists/listinfo/nant-users

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
NAnt-users mailing list
NAnt-users@...
https://lists.sourceforge.net/lists/listinfo/nant-users

Re: Adding a redirect to null in exec?

by Steve Kapinos :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Nope - same result... I thought that as well... but in both cases psexec
exists with the same message, so the > is surviving I suppose due to be
enclosed in quotes?

I was able to finally pass it with this brute force method using
commandline and calling cmd.exe instead of calling the command itself.

<target name="test4" >
<exec program="cmd.exe" workingdir="." commandline="/c psexec.exe
-accepteula \\10.0.27.142 -u administrator -p TANDBERG ping 127.0.0.1 >
nul"/>
</target>



-----Original Message-----
From: nant-users-bounces@...
[mailto:nant-users-bounces@...] On Behalf Of Roebuck,
Alex
Sent: Monday, September 15, 2008 8:41 AM
To: Steve Kapinos; nant
Subject: Re: [NAnt-users] Adding a redirect to null in exec?

Hi Steve,

Use the escape sequence > in place of >.

e.g.:

 <arg line="> nul"/>

Regards,

Alex Roebuck.

-----Original Message-----
From: nant-users-bounces@...
[mailto:nant-users-bounces@...] On Behalf Of Steve
Kapinos
Sent: Monday, September 15, 2008 1:34 PM
To: nant
Subject: [NAnt-users] Adding a redirect to null in exec?

When doing an exec task, how can I add a > nul at the end of the
command?

Trying to work around issues with psexec, they suggest piping the output
to Null.  But I can't seem to modify my task to get the desired effect.

The command I'm trying to incorporate is simply

Psexec.exe -accepteula \\10.0.27.142 -u administrator -p TANDBERG ping
127.0.0.1 > nul

Trying to put that into an exec task with arg line

        <target name="test" >
                <exec program="psexec" basedir="." workingdir=".">
                                <arg line="-accepteula"/>
                                <arg line="\\10.47.27.142"/>
                                <arg line="-u administrator"/>
                                <arg line="-p TANDBERG"/>
                                <arg line="ping 127.0.0.1"/>
                                <arg line="> nul"/>
                </exec>
        </target>

I get

     [exec]
     [exec] PsExec v1.94 - Execute processes remotely
     [exec] Copyright (C) 2001-2008 Mark Russinovich
     [exec] Sysinternals - www.sysinternals.com
     [exec]
     [exec] Bad parameter >.

Is there any way to add a pipe to the end of an exec statement like
this?  Only thing else I've considered is putting the command itself
into a batch file.

------------------------------------------------------------------------
-
This SF.Net email is sponsored by the Moblin Your Move Developer's
challenge
Build the coolest Linux based applications with Moblin SDK & win great
prizes
Grand prize is a trip for two to an Open Source event anywhere in the
world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
NAnt-users mailing list
NAnt-users@...
https://lists.sourceforge.net/lists/listinfo/nant-users

------------------------------------------------------------------------
-
This SF.Net email is sponsored by the Moblin Your Move Developer's
challenge
Build the coolest Linux based applications with Moblin SDK & win great
prizes
Grand prize is a trip for two to an Open Source event anywhere in the
world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
NAnt-users mailing list
NAnt-users@...
https://lists.sourceforge.net/lists/listinfo/nant-users

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
NAnt-users mailing list
NAnt-users@...
https://lists.sourceforge.net/lists/listinfo/nant-users
LightInTheBox - Buy quality products at wholesale price!