How do i clear Screen on AGENS command line - agens-graph

How do i clear screen on the AGENS Command Line ?
I tried using the following command
cl scr
clear screen
clear
cls
Ctrl + L
and most i could think of. Can you please help me?

I am not sure I get your question correctly, but I assume that you are trying to clear the console command.
If what I understand is correct, you may try the following command :
agens=# \! clear
It is just same as what we do in pg console.

I just found that the code to clear the screen in agens is:
agens=# \! cls

Related

Return ErrorLevel or console message if NIRCMD.exe fails

I am looking for a way to identify if NIRCMD fails to do what i ask it to do. Is there a way to have NIRCMD to tell me if it fails?
Example:
"nircmd.exe" win activate title "Untitled - Notepad"
The above code works because I have this file open.
"nircmd.exe" win activate title "Untitled - Notepad12345"
The above code DOES NOT work because this window does not exist yet Nircmd acts like it runs ok in the CMD prompt and not giving any type of message letting me know it did not actually do what i asked it to do.
Also, the "NIRCMD showerror" results in no errors.

Move ConEmu prompt to new line following path?

ConEmu by default has a prompt which is like "${cwdfull}>" I'd like instead, "${cwdfull}\n> ". How do I customize this? I see it must be possible since cmdr which is based on ConEmu has it.
Thanks in advance!
ConEmu by default
conemu -basic -cmd {cmd}
has following prompt
You can easily check how it is created in Tasks and %ConEmuBaseDir%\CmdInit.cmd batch file. All "magic" is done by PROMPT variable. For example set PROMPT=$P$_$G.
Update
I really do not understand your question from the comment below. Default ConEmu task {cmd (Admin)} has the same prompt and its configuration is done by absolutely the same way.

Type command not working in Windows command prompt

Correct me if I'm wrong, but the type command is supposed to display the contents of a text file in the Windows command prompt. But whenever I use the type command to display a text file, the output is only:
Unable to initialize device PRN
The command used is:
type C:\Users\Matthew\Desktop\Hello.txt
I don't know why it's doing this and I can't seem to figure it out. So if anyone could help me, it would be greatly appreciated.
You echoed a 'print' command response to your file.
Open it with Notepad to verify.
Type is working (that's what's in the file).
"Unable to initialize device PRN" is an odd error, you must be using an old version of Dos which is attempting to use a printer.
Which means you're either using the print command, or something you're trying to type is confusing the type command and returning an error.
set /p text=<type C:\Users\Matthew\Desktop\Hello.txt
echo "%text%" && pause

BAT file programming assistance : how to make a response in a bat file copy to another part OR to clipboard?

My apologies if the title was confusing. It should be fairly basic, but I cannot find a way to do this.
What i'm wanting to do is have a bat file prompt for an answer to a question and then surround that answer with another piece of code and either copy to the clipboard or after the connection.
Maybe it will make more sense if i give the code.
#echo off
set /p input ="what server would you like to connect to? (example srv02) :"
echo Myhome.%input%.com
pause
c:\program files\putty
the echo gives the correct response, but i would like to see if there is a way to paste this past the c:\program files\putty to connect to a server.
OR if there is a way to copy that response to the clipboard so the bat file would open putty (which it does now) and then you could just paste that response.
Or am i going about this the wrong way? thanks for the help!!
I'm not a PuTTY user, so I can't be sure - But I believe you are simply trying to pass the the server host that you want to connect to. I think the following will do what you asked:
"c:\program files\putty" %input%
or
"c:\program files\putty" Myhome.%input%.com
However, there are probably other command line options you need to really accomplish your goal.
You should learn the PuTTY command line arguments and options. I suspect a web search could find some tutorials or examples to get you started.
Perfect! That is what i ended up doing after a few more hours of research.
I came up with two different types of scripts as my company wants us to use a specific set of defaults for different servers.
#echo off
set /p input="what server would you like to connect to? : "
echo myhome.%input%.com| clip
echo ----
echo myhome.%input%.com has been copied to your clipboard,
echo you can now paste into the host name box in putty
echo -----
echo Press enter to open puTTY
echo -----
Pause
start c:\users\public\apps\putty.exe
Ended setting it to open putty instead of pasting because it should be defaulted settings, but not everyone kept it that way, of course.
Thanks for the assistance though!

Gracefully trap error on start cmd

On a cmd prompt or bat file, I issue the following:
start textpad myfile.txt and it works fine.
If the program textpad does not exist on the computer, then an error sound and a popup occurs which the OK button must be pushed.
I desire to trap this error so that I could do something like
start textpad myfile.txt || start notepad myfile.txt
where the || implies that if the start of textpad is not successful, then the start of notepad should occur. HOWEVER, I still get the error sound and requirement of hitting OK.
My intent is to avoid the sound and the requirement of any user intervention.
I have also tried the following bat approach below, to no avail.
start textpad
if not %ERRORLEVEL% == 0 GOTO END
start notepad
:END
Any help would be great.
thanks
ted
You can use the following little snippet to find out whether the program you intend to launch exists:
for %%x in (textpad.exe) do set temp=%%~$PATH:x
if [%temp%]==[] echo Didn't exist.
But may I suggest that you simply use
start foo.txt
instead of forcing a specific editor onto the user? File type associations are there for a reason.
I do not believe you will find a way to make that work. Perhaps look for the existence of textpad.exe on the machine? If you can predict what directory it would be loaded from, this should be pretty easy using IF EXIST.
There are some techniques to detect the presence of a specific tool, but this only works for command line tool, or with GUI applications also supporting command line options.
For these tricks, take a look at this page.
"/wait" parameter would do the trick for you..
START /wait NOTEPAD.EXE SOME.TXT
echo %ERRORLEVEL%
# This gives zero as output.
START /wait TEXTPAD.EXE SOME.TXT
echo %ERRORLEVEL%
# This gives non-zero output.
You probably already have an answer, but my over-sized ego has forced me to post my answer.
So, this should work.
start textpad 2> nul||start notepad
This will start notepad if the command start texpad fails, while also redirecting any error message you may get from the first command.

Resources