Cómo eliminar archivos en la línea de comandos de eventos de precompilación de Visual Studio


Estoy intentando eliminar archivos en mi $(TargetDir) dentro de visual studio antes de crear un proyecto.

¿Cómo tiene que formatear la línea de comandos para solucionar este problema que estoy recibiendo a continuación? texto alt

Author: Community, 2009-04-20

6 answers

Intenta

cd $(TargetDir)
del *.tif

Como jvenema señaló, su Targ(TargetDir) se está expandiendo en una ruta que contiene espacios en los nombres de las carpetas que está rompiendo el comando eliminar.

 68
Author: Eoin Campbell,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2009-04-20 13:46:20

Terminé usando rd /s /q "$(TargetDir)" para limpiar el directorio. Por lo que sé, está funcionando.

 25
Author: tuck,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2011-08-17 18:14:26

Intente agregar comillas alrededor del directorio.

 14
Author: jvenema,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2009-04-20 13:36:25

Tienes que escribir del "$(TargetDir)*.tif" debido a los espacios en la ruta del directorio.

 10
Author: Václav Dajbych,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2011-10-17 21:25:35

Vieja pregunta, pero un par de cosas:

del "$(TargetDir)*.tif" /q

1) / q es para quiet. De lo contrario, del cmd pide "... Estás seguro (S/N)?"que a la construcción no le gusta.

2) Como muchos han señalado, "" alrededor del targetDir para un posible espacio en el directorio de destino.

 1
Author: Sudip Shrestha,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2018-03-08 22:04:47

Proceso Wmic donde name='chromedriver.exe' delete

 0
Author: Meg-90,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-04-21 00:57:13