I experienced problems running winetricks (a wine helper script) on my Fedora 16 x86_64 desktop.

It simply won’t run and show the following error output:

wine cmd.exe /c echo '%ProgramFiles%' returned unexpanded string '%ProgramFiles%'
... can be caused a corrupt wineprefix, an old wine, or by not owning /home/user/.wine

In my case it was related to a missing env variable, so I just had to:

export ProgramFiles="C:\Program Files"
  • Edit: just found this fix by nick.soracco:

open a terminal

create a new file (eg. vi wine64fix.reg) with the following content:

[HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment]
"ProgramFiles"="C:\\Program Files"

Save it and then commit the following from your shell prompt:

wine regedit wine64fix.reg

This should definitively fix this problem that uses to pop up once again time by time.