Spooling File to My Desktop From Back-end using shell script

Hello all,
I am trying to spool a SQL query output file from back-end to desktop in a certain path but it didn't work,the query writes the output in a file in the same directory at the back-end.
note : i use the same query in sql developper and file was created in the desired path fine

code :
-------

sqlplus -s schemaname/pass@dbname <<SQL
spool C:\pathtofile\testtest.csv;
select count(*),sum(amount) from (databaseschem).(tablename)

some conditions here;

spool off;
SQL

---------------------
so can anyone figure out the reason for this ?

when sqlplus is run what user is logged into oracle? i.e., sqlplus username@password
Is that user identical and on the same physical oracle server machine as the user that works correctly?