Code: Select all
;thank you
;to this guy https://titanwolf.org/Network/Articles/Article?AID=afa0bc13-b32a-48f3-96d0-6b90cf8c9b75#gsc.tab=0
;now this compiled as console
;if run it in console will output inside the console
;you do not need openconsole() anymore
;thank you Priya !!!
;
ImportC "msvcrt.lib"
system(str.p-ascii)
EndImport
;system("setlocal enabledelayedexpansion")
system("echo salut")
and
Code: Select all
ImportC "msvcrt.lib"
system(str.p-ascii)
EndImport
;system("setlocal enabledelayedexpansion")
Procedure say(text.s)
system("echo "+text)
EndProcedure
say(" Hello from PureBasic ,the best!")
ps.now i see the .exe 's size is 6kb !!!!! yahooooo
without this will not work: compiler -> compiler options -> Executable format: console
by removing the option
Enable modern theme support(for Windows XP and above) the .exe size drop to 5kb !!!
I tested fine in 5.73 LTS x64 and the new one.. the 6.00 alpha 3 x64 !
// Edit: Topic title adapted. @xpectmore: Please avoid writing everything in capital letters and do not use too many exclamation marks.
using compiler -> compiler options -> Executable format: console the same with this the system waiting to press a key :
Code: Select all
Procedure run(cmd.s)
RunProgram("c:\windows\system32\cmd.exe", "/c"+cmd, "")
EndProcedure
run("echo I have something to say you")
new test success :
Code: Select all
Procedure say(cmd.s)
cmd2.s="echo "+cmd;cmd2.s=UnescapeString("echo "+cmd)
test=RunProgram("c:\windows\system32\cmd.exe", "/c"+cmd2, "",#PB_Program_Open | #PB_Program_Connect)
If test
While ProgramRunning(test)
WriteProgramStringN(test,cmd2,#PB_Ascii )
Wend
CloseProgram(test)
EndIf
EndProcedure
say("I have something to say you")
say("do not learn c/c++/c# : you have PureBasic")
not the answer of his question (TheCube ) but the hide method to run using same settings compiler -> compiler options -> Executable format: console:
Code: Select all
Procedure system(cmd.s)
RunProgram("c:\windows\system32\cmd.exe", "/K"+cmd, "", #PB_Program_Hide)
EndProcedure
system("echo i write this hidden> purebasic.txt")
system("echo do not learn c/c++/c# : you have PureBasic>> purebasic.txt")
so compiled .exe[s] on the destop i check 3 of these (the hidden version too) inside virustotal.com and at the moment the result was:
not even a false positive virus witch is GREAT !!!