Deleting file in Execute console
-
Answer, please, if there is any npp-console command (such as npp-save) for deleting file. I need to delete old executable file before compilation on g++. Maybe you know another way to prevent running of the old exe-file if compilation is failed. Example:
PP_SAVE: C:\Qt\MinGW\projects\02\test3.c
CD: C:\Qt\MinGW\projects\02
Current directory: C:\Qt\MinGW\projects\02
g++ “test3.c” -o test3 -march=native -O3 -std=c++11
Process started >>>
test3.c: In function ‘int main()’:
test3.c:54:23: error: ‘vu33’ was not declared in this scope
for (; c3_Iter != vu33.end(); c3_Iter++)
**<<< Process finished. (Exit code 1)
NPP_RUN: test3 ** -
-
Thanks, Claudia.
But:
Result of adding command " del $(NAME_PART).exe" in Execute script:NPP_SAVE: C:\Qt\MinGW\projects\02\test3.c
CD:
Current directory: C:\Qt\MinGW\projects\02
del test3.exe
CreateProcess() failed with error code 2:
the specified file was not foundResult of adding command “NPP_RUN del test.exe”
NPP_RUN: del test.exe- the specified file was not found
-
you need to call it from within the cmd shell.
See NppExec notes4.4. Using cmd.exe
NppExec by itself does not support standard console commands such as “copy”, “move”, “mkdir”, “for” etc. Actually, these commands are part of system’s command interpreter (cmd.exe). So, you can use cmd.exe to perform such commands. For example, you can type the following commands in NppExec’s Console or inside NppExec’s script:
// create a directory C:\Backup cmd /c mkdir C:\Backup // save current Notepad++'es file NPP_SAVE // copy current file to C:\Backup cmd /c copy "$(FULL_CURRENT_PATH)" "C:\Backup\$(FILE_NAME)" /Y // change current directory cd C:\Backup // list all .txt files in C:\Backup cmd /c for %f in (*.txt) do @echo %fIf you want to see what happens within the cmd shell, replace /C with /K
and console will stay open.Cheers
Claudia -
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login