Change folder within script

I have a folder on my desktop which is to be compressed with a “gnutar” command. For that I activate the following script command :

set scriptCommand to "gnutar czf " & posArcive & " " & posDeskTop & theLastLog

Where command line parameters are full desktop path (starts from “user”). It works properly, and a “.tgz” file is created on the desktop. When decompressing the archived file it creates a folder “user” on the desktop, where the actual folder is located three stages deep.

I would like to change it so that when decompressing the archived file it creates the original folder on the desktop.
In order to do this I am trying to activate a unix shell "cd " to the desktop so that the archive is created from the desktop and not from the top “user” folder.

Al my attempt to add a “cd” script failed.

do shell script "cd /myfolder/ | pwd " it always shows the root directory. “/”

Can any one help me.

Model: G4
AppleScript: 1.9.3
Browser: Safari 125
Operating System: Mac OS X (10.3.9)

set source_folder to "/Users/chris/Desktop/"
set ls to do shell script "cd " & source_folder & "
ls -tl"