Execute Native Commands
Post any question you may have in regards to GoAnywhere Director and let our talented support staff and other users assist you.
5 posts
Page 1 of 1
I have a simple test project to delete a file using the windows cmd.exe command. I'm just trying to test out functionality and I can't get it to work. XML is below. Anyone using cmd.exe?
Code: Select all
<project name="test" mainModule="Main" version="2.0" logLevel="debug">
<module name="Main">
<createWorkspace label="Create Workspace" version="1.0" />
<exec executable="C:\Windows\System32\cmd.exe" version="1.0">
<arg value="del C:\temp\test.rtf" />
</exec>
<deleteWorkspace label="Delete Workspace" version="1.0" />
</module>
</project>
- Support Specialist
- Posts: 590
- Joined: Tue Jul 17, 2012 2:12 pm
- Location: Phoenix, AZ
-
Try this:
Code: Select all
<project name="Test CMD" mainModule="Main" version="2.0" logLevel="debug">
<module name="Main">
<createWorkspace label="Create Workspace" version="1.0" />
<exec executable="C:\Windows\System32\Cmd.exe" version="1.0">
<arg value="/k" />
<arg value="Del C:\Temp\Test.rtf" />
</exec>
<deleteWorkspace label="Delete Workspace" version="1.0" />
</module>
</project>
Rick Elliott
Lead Solutions Consultant
(402) 944.4242
(800) 949-4696
Lead Solutions Consultant
(402) 944.4242
(800) 949-4696
- Support Specialist
- Posts: 590
- Joined: Tue Jul 17, 2012 2:12 pm
- Location: Phoenix, AZ
-
The /k argument is from the definition of the CMD.EXE
/k : Carries out the command specified by the string but remains active
/c : Carries out the command specified by the string and then terminates
If you are going to use the CMD.EXE, please review the Help Text on that command and it will further explain. Otherwise, you should be able to address the ERASE or DEL commands directly without having to call the CMD.EXE.
Another option is to create a BAT file that contains the commands you want to execute and then just call the BAT file from the EXEC Task.
/k : Carries out the command specified by the string but remains active
/c : Carries out the command specified by the string and then terminates
If you are going to use the CMD.EXE, please review the Help Text on that command and it will further explain. Otherwise, you should be able to address the ERASE or DEL commands directly without having to call the CMD.EXE.
Another option is to create a BAT file that contains the commands you want to execute and then just call the BAT file from the EXEC Task.
Rick Elliott
Lead Solutions Consultant
(402) 944.4242
(800) 949-4696
Lead Solutions Consultant
(402) 944.4242
(800) 949-4696
5 posts
Page 1 of 1