[PHP] Path names in exec()

I’m trying run htpasswd.exe from a php page on localhost. I wanted to use php’s crypt function but windows only allows the MD5 passwords. I can run the program fine from DOS but when i try the full path name in the exec function i get:

‘c:\Program’ is not recognized as an internal or external command,

I’ve even tried urlencoding the path name but that doesnt work. I haven’t tried moving the htpasswd.exe file to the same file as the php script but I don’t want to do that.

Does anyone have any suggestions?