NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Using Custom Commands in the Deployment Utility for TestStand, can I use the del command?...I keep getting an error...

Hello,

 

I have used xcopy in the past in the custom commands with no issue but I now want to delete a certain file from the "SupportVIs" folder that is automatically generated.  I have tried doing so using del "path\file.exention" however, I get and error "error code:2 ... the system cannot finde the file specified.  H put the same command in cmd and it works like a champ...If this file was available in exclude under "View Destination" I would but it is automatically put in the SupportVIs where I cannot exclude it.  I have also tried adding the file to the filter.ini but that did not work either...still showed up in the "SupportVIs" folder (I may have modified the filter.ini file wrong but I don't think so).

 

Any thoughts?

 

I tried to xcopy the file and that worked from the custom commands but for some reason I just can't use the del function...

 

 

0 Kudos
Message 1 of 8
(4,578 Views)

Hi. In order to better help, could you answer the following questions?

 

  1. Why are you trying to delete the file?
  2. What type of file are you removing? Is it a VI? Is this VI being called by another VI in your TestStand sequence?
  3. Are you using an absolute path or a relative path when using the del command?
  4. Ensure you are using the proper command syntax. Have you tried using erase instead of del?

Please let me know. 

 

Brittany V

Applications Engineer

0 Kudos
Message 2 of 8
(4,547 Views)

1) i want/need to delete it...i am trying not to modify my source code and if i can just modify the installer, my task would be easier.

2) .dll file

3) using absolute path

4) yes, tried both and tried various syntax

0 Kudos
Message 3 of 8
(4,457 Views)

Thank you, queenlooners. A few follow up questions for you:

 

- What version of TestStand are you using? What OS?

- What modifications are you making to the filter.ini file, and where are you making the modifications?

0 Kudos
Message 4 of 8
(4,434 Views)

Teststand 2010 and Windows 7 and Windows 7...both do the same thing.

 

i was adding .dll extention to filter file but that did nothing.  I don't want to modify the filter file, I only want to be able to delete from the custom commands.  I dont' understand why it won't let me.

 

Thanks.

0 Kudos
Message 5 of 8
(4,329 Views)

A lot of guess work:

 

If you search through the windows folder you will find a "xcopy.exe" but no "del.exe" or "erase.exe".

 

I'm guessing that the custom command environment is not simply using the cmd command shell of windows but something else. That would mean that it can use xcopy as this is an actual executable which is found by windows search paths but not command shell internal commands like "del" or "erase".

 

I'm not quite sure if it would be possible to wrap your command in a way that it is called through the command shell. Something like (more guesswork):

 

cmd /c del <path>\<filename>.dll

 

Best Regards

 

Mathis

 

edit: changed to cmd /c ... that might work

0 Kudos
Message 6 of 8
(4,319 Views)

Mathis is correct in that the custom commands does not execute exactly like the Windows command line. You could also try putting your command in a batch file, and then calling the batch file as your custom command.

0 Kudos
Message 7 of 8
(4,300 Views)

Hi queenlooners, 

 

As Mathis mentioned, the custom commands are called by the deployment installer as an executable (the installer invokes each custom command you specify using the windows CreateProcess() command). Because of this, you need to specify an executable to run, in this case cmd.exe, using the "/c" argument to specify thta the cmd.exe process run the command you specify.  I have made a note to clarify this point in the custom commands documentation.

 

Regarding the filter.ini, filters you add do not apply to VIs, only EXEs and DLLs.  This should also be more clearly documented, and we plan to improve the filter.ini documentation in a future TestStand version.

Al B.
Staff Software Engineer - TestStand
CTA/CLD
0 Kudos
Message 8 of 8
(4,296 Views)