# Visual Basic > Visual Basic 6 and Earlier >  vb6 executing Plink psql command

## csdav

HI, 
can I be helped?
I get a compile error  syntax error on the strdate4 line.
this is in the formload section.
my goal is to populate the Text3 textbox with the output of the strdate4 command
Thanks so much in advance.


Private Sub Form_Load()
strdate4 = ("plink -pw mypassword myuname@server psql -Upostmems -dproperties -t -c "select version from formu.system_rents WHERE version Like '%3.6.7%' limit 1;"")

Shell "cmd /c " + strdate4 + " > " + "C:\fso\tempcommand.txt", vbNormalFocus
ff = FreeFile
Open "C:\fso\tempcommand.txt" For Input As #ff
Text3 = Input(LOF(ff), #ff)
Close #ff
End Sub

----------


## Arnoutdv

You have incorrect syntax for building a string.
Start with removing the ()

----------


## csdav

Thanks, I removed the () and it appears to execute however it does not populate  the C:\fso\tempcommand.txt file
could there be a way to make the command window remain open so that I can see what actually is executed?

----------


## Arnoutdv

Whats the exact content of strdate4?
You can check this with adding the following statement 
Debug.Print strdate4

Also use & instead of + when appending string values

----------


## Eduardo-

Also quotes inside strings must be escaped with double quotes:



```
strdate4 = "plink -pw mypassword myuname@server psql -Upostmems -dproperties -t -c ""select 
version from formu.system_rents WHERE version Like '%3.6.7%' limit 1;"""
```

----------

