Execute command to execute command prompt command

Post Reply
braam
Newbie
Posts: 7
Joined: Wed Aug 31, 2011 11:28 am

Execute command to execute command prompt command

Post by braam »

Hi



I am trying to use the execute command to run a MS-Dos prompt command, but its not working...I get the error that it cant run command "XYZ"...in the error messages....but when I copy the error details and paste it in command prompt...it runs 100%.

I am running windows 7 with powerswitch 08.



Heres how I use it:



Execute Command Module settings:

Command or Path:rd

Arguments: /S /Q "C:ttest[Name.Proper]



Output:None



(So this is basically to delete a specific folder relating to the incoming file...which as I said works 100% If I do it manually)



I thought of maybe having to call the command prompt first like this:

Execute Command Module settings:

Command or Path:c:windowssystem32cmd.exe

Arguments: rd /S /Q "C:ttest[Name.Proper]



But with this the process just hangs on executing command until it times out.



Any one maybe have any ideas as to where I am missing something? Im not 100% sure about how the execute command works...I got it working for extracting and compressing winzip files, where I just called the zip7 module....but this seems different, I assumed it automatically uses the command propmt, but Im obviously wrong about something



Any help will be fantastic!
Clive Andrews
Member
Posts: 85
Joined: Thu Jun 23, 2011 11:41 am

Execute command to execute command prompt command

Post by Clive Andrews »

Have you thought of trying PSEXEC to call the command...?



http://technet.microsoft.com/en-us/sysi ... s/bb897553



I'm no great MS Techie, but have solved other issues with it...
braam
Newbie
Posts: 7
Joined: Wed Aug 31, 2011 11:28 am

Execute command to execute command prompt command

Post by braam »

Hi Clive



Brilliant, Thank you very much. What a awesome tool. So it does seem that calling cmd.exe directly from the Execute command tool does not work, but this works 100%.



So my execute command now looks like this:



command or path:c:PsExec.exe

Arguments(single line text with variables):

cmd /c rd /S /Q "10.10.69.117WWWWebsitesXYZ[Job.NameProper]"



Thanks again for the suggestion. Very happy that it works so well.



Kind Regards

Braam


Post Reply