Jump to content

strawberry12

Members
  • Posts

    3
  • Joined

  • Last visited

strawberry12's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. OK, I've been playing about some more, and it now seems that this is really a permissions issue. My guess is that our IT people performed some kind of server update that has had the effect of restricting apache's/php's permissions in some way. So a different kind of problem altogether... :-(
  2. Thanks, I didn't know about that constant. However, I don't think that's quite the problem... My code currently looks like this... $string = "xcopy \\\\my-server\\ourstuff\\live_projects\\xxxx_Project\\*.* \\\\my-server\\ourstuff\\live_projects\\$projectstr /e /k /i /c"; echo $string; exec($string); Given a $projectstr like '9999_test', the echo looks like this: xcopy \\my-server\ourstuff\live_projects\xxxx_Project\*.* \\my-server\ourstuff\live_projects\9999_test /e /k /i /c The exec doesn't do anything, but if I cut and paste that echo into the command line, it works fine - so what am I missing?
  3. I have a shell command in Windows that copies and renames a folder to the same location. The working command looks like this: xcopy \\my-server\ourstuff\live_projects\xxxx_Project\*.* \\my-server\ourstuff\live_projects\projectstr /e /k /i /c I want to execute this command from within PHP using the exec() function. projectstr should really be a string variable ($projectstr) that, at present, may contain alphanumeric characters, spaces, minus signs, and underscores, but not commas, apostophes, or quotation marks. Is there a simple technique for rewriting this for the exec() command? I get so lost in backslashes and quotation marks that I don't know whether I'm coming or going. Any help appreciated.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.