WARNING: no command supplied after key change

Hello,
I have gpg4win installed installed on a windows server 2016 Datacenter for 3-4 years now and i created some scripts for encrypt/decrypt files.
All was working fine until recently when a pair of my keys are approaching the expiration date so i created a new pair in advance in order to share (the public key) with the other person whom i am exchanging the files.

So i modified the script that encrypts the files to use the new key and passphrase.
The command is the one below:
gpg --trust-model always --pinentry-mode=loopback --passphrase "passphrase" --local-user "newuser" --recipient "recipient" --armor --sign --output "pgpfile" --encrypt "sourcefile"

If i run this command from a command prompt the file is encrypted as expected.
However, when the script is executed it fails to encrypt the file.
It will display the warning “no command supplied. Trying to guess what you mean …” and it will just hang there.

It is strange how gpg command would execute without warning when running it from cli but complain about the syntax inside the script.
I am thinking if the passphrase is causing this behavior because it includes some special characters like $ and %.
This is the only difference that i can find comparing with the previous key but i wouldnt have the same issue when i run the command from cli as well?

Please advise.