-
Notifications
You must be signed in to change notification settings - Fork 0
/
RunOnlyUsingCMD
72 lines (64 loc) · 1.93 KB
/
RunOnlyUsingCMD
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
npp_console 1 //open console
NPP_CONSOLE - //disable output of commands
npe_console -- m- //disable unnecessary output
con_colour bg= 191919 fg= F5F5F5 //set console colors
npp_save //save the file
cd $(CURRENT_DIRECTORY) //follow current directory
NPP_CONSOLE + //enable output
IF $(EXT_PART)==.c GOTO C //if .c file goto C label
IF $(EXT_PART)==.cpp GOTO CPP //if .cpp file goto CPP label
IF $(EXT_PART)==.java GOTO JAVA //if .java file goto JAVA label
IF $(EXT_PART)==.cs GOTO C# //if .cs file goto C# label
IF $(EXT_PART)==.py GOTO PYTHON //if .py file goto PYTHON label
echo FILE SAVED
GOTO EXITSCRIPT // else treat it as a text file and goto EXITSCRIPT
//C label
:C
NPP_CONSOLE -
npe_console v+
cmd /c if exist "$(NAME_PART).exe" echo Exists
npe_console v-
NPP_CONSOLE +
if "$(OUTPUTL)" != "Exists" goto NOT_FOUND
echo C CODE OUTPUT:
NPP_RUN cmd /c $(NAME_PART) & COLOR 0A & PAUSE
GOTO EXITSCRIPT
:CPP
NPP_CONSOLE -
npe_console v+
cmd /c if exist "$(NAME_PART).exe" echo Exists
npe_console v-
NPP_CONSOLE +
if "$(OUTPUTL)" != "Exists" goto NOT_FOUND
echo C++ CODE OUTPUT:
NPP_RUN cmd /c $(NAME_PART) & COLOR 0A & PAUSE
GOTO EXITSCRIPT
:JAVA
NPP_CONSOLE -
npe_console v+
cmd /C if exist "$(NAME_PART).class" echo Exists
npe_console v-
NPP_CONSOLE +
if "$(OUTPUTL)" != "Exists" goto NOT_FOUND
echo JAVA CODE OUTPUT:
NPP_RUN cmd /c java $(NAME_PART) & COLOR 0A & PAUSE
GOTO EXITSCRIPT
:C#
NPP_CONSOLE -
npe_console v+
cmd /c if exist "$(NAME_PART).exe" echo Exists
npe_console v-
NPP_CONSOLE +
if "$(OUTPUTL)" != "Exists" goto NOT_FOUND
echo C# CODE OUTPUT:
NPP_RUN cmd /c $(NAME_PART) & COLOR 0A & PAUSE
GOTO EXITSCRIPT
:PYTHON
echo PYTHON SCRIPT OUTPUT: //python is a script so no need to compile
NPP_RUN cmd /c python $(NAME_PART).py & COLOR 0A & PAUSE
GOTO EXITSCRIPT
:NOT_FOUND
echo EXECUTABLE NOT FOUND:
GOTO EXITSCRIPT
:EXITSCRIPT
// that's all, folks!