In PgAdmin, the command is COPY rather than \COPY. The rest of the code remains the same. Another difference is that we need to use an absolute path, while in psql we can use paths relative to the directory we started psql in.
So the first psql query translated to the PgAdmin SQL version looks like this:
copy data_import.earthquakes_csv TO 'F:\mastering_postgis\chapter06\earthquakes.csv' WITH DELIMITER ';' CSV HEADER
The second query looks like this:
copy (select id, ST_AsText(geom) FROM data_import.earthquakes_subset_with_geom) TO 'F:\mastering_postgis\chapter06\earthquakes_subset.csv' WITH CSV DELIMITER '|' FORCE QUOTE * HEADER
Both produce a similar output, but this time it is logged in PgAdmin's query output pane Messages tab:
Query returned successfully: 50 rows affected, 55 msec execution time.
It is worth remembering that COPY is executed as part of an SQL command, so it is effectively the DB server that tries to write to a file. Therefore, it may be the case that the server is not able to access a specified directory. If your DB server is on the same machine as the directory that you are trying to write to, relaxing directory access permissions should help.