01-19-2016 06:31 PM
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...
01-20-2016 04:33 PM
Hi. In order to better help, could you answer the following questions?
Please let me know.
Brittany V
Applications Engineer
01-28-2016 01:01 PM
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
01-29-2016 04:33 PM - edited 01-29-2016 04:34 PM
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?
02-11-2016 06:23 PM
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.
02-12-2016 06:00 AM - edited 02-12-2016 06:04 AM
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
02-12-2016 02:40 PM
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.
02-12-2016 02:59 PM
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.