redarrow Posted June 27, 2008 Share Posted June 27, 2008 hi there advance thank you... can you tell me what i am doing wrong to exec my program from php <?php exec('C:/Documents and Settings/admin/Desktop/image programs/snapshotter.exe -u "http://google.com" -o "c:/images/test.jpg" -w 120 -h 120 '); ?> Quote Link to comment https://forums.phpfreaks.com/topic/112217-exec-not-working/ Share on other sites More sharing options...
redarrow Posted June 27, 2008 Author Share Posted June 27, 2008 i want this to execute dos then change direrectory in dos then use that program with the given values any help please... <?php exec('C:/windows/system32/cmd.exe, cd image programs, snapshotter.exe -u "http://google.com" -o "c:/images/test.jpg" -w 120 -h 120 '); ?> Quote Link to comment https://forums.phpfreaks.com/topic/112217-exec-not-working/#findComment-576065 Share on other sites More sharing options...
Jabop Posted June 27, 2008 Share Posted June 27, 2008 ...what goes wrong? Quote Link to comment https://forums.phpfreaks.com/topic/112217-exec-not-working/#findComment-576091 Share on other sites More sharing options...
redarrow Posted June 27, 2008 Author Share Posted June 27, 2008 The whole program, there no error just no result the image from the 3rd party program dosent do it stuff... Quote Link to comment https://forums.phpfreaks.com/topic/112217-exec-not-working/#findComment-576096 Share on other sites More sharing options...
Jabop Posted June 27, 2008 Share Posted June 27, 2008 I don't know much about using exec() on windows, but, I know that windows filesystem is backslashes, maybe that's your problem Quote Link to comment https://forums.phpfreaks.com/topic/112217-exec-not-working/#findComment-576097 Share on other sites More sharing options...
redarrow Posted June 27, 2008 Author Share Posted June 27, 2008 This is where the application is.... C:/Documents and Settings/admin/Desktop/image programs/snapshotter.exe but i need the command prompt to execute it........... any idears or does exec do it automatickly example exec('cmd.exe,C:/Documents and Settings/admin/Desktop/image programs/snapshotter.exe'); get me how to get the command prompt to execute the current .... Quote Link to comment https://forums.phpfreaks.com/topic/112217-exec-not-working/#findComment-576102 Share on other sites More sharing options...
redarrow Posted June 27, 2008 Author Share Posted June 27, 2008 example is this how to use exec() to get command prompt to execute a folder in it windows folders <?php exec(' C:\WINDOWS\system32\cmd.exe,C:\Documents and Settings\ad min\Desktop\image programs\snapshotter.e xe -u "http://google.com" -o "c:/i mages\test.jpg" -w 120 -h 120" '); ?> Quote Link to comment https://forums.phpfreaks.com/topic/112217-exec-not-working/#findComment-576105 Share on other sites More sharing options...
redarrow Posted June 27, 2008 Author Share Posted June 27, 2008 HERE WHAT I WANT TO DO BUT HOW PLEASE.... i have tried all backslash foward slash everthink........... all works manually with the 3rd party program....... so i need to no how to change a directory CD while using exec() while in cmd.exe..... tried everythink man............. <?php exec(' C:/WINDOWS/system32/cmd.exe'); //open cmd.exe exec('Desktop/image programs'); // goto this directory from cmd.exe exec('snapshotter.exe -u "http://google.com" -o "c:/images/test.jpg" -w 120 -h 120');// execute this from folder image programs ?> Quote Link to comment https://forums.phpfreaks.com/topic/112217-exec-not-working/#findComment-576123 Share on other sites More sharing options...
Jabop Posted June 27, 2008 Share Posted June 27, 2008 <?php exec(' C:\WINDOWS\system32\cmd.exe,C:\Documents and Settings\admin\Desktop\image programs\snapshotter.exe -u "http://google.com" -o "c:/images\test.jpg" -w 120 -h 120" '); ?> Quote Link to comment https://forums.phpfreaks.com/topic/112217-exec-not-working/#findComment-576125 Share on other sites More sharing options...
redarrow Posted June 27, 2008 Author Share Posted June 27, 2008 tried that mate many times but thanks for helping......... anyone please Quote Link to comment https://forums.phpfreaks.com/topic/112217-exec-not-working/#findComment-576128 Share on other sites More sharing options...
redarrow Posted June 28, 2008 Author Share Posted June 28, 2008 did any one no how to use the exec() for php please cheers..... below is my quistion friends........... everthink works manualy but not using the exec() function............. yes i tried the exec() function and it works fine with a sample file........ <?php exec(' C:/WINDOWS/system32/cmd.exe'); //open cmd.exe exec('Desktop/image programs'); // goto this directory from cmd.exe exec('snapshotter.exe -u "http://google.com" -o "c:/images/test.jpg" -w 120 -h 120');// execute this from folder image programs ?> Quote Link to comment https://forums.phpfreaks.com/topic/112217-exec-not-working/#findComment-576685 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.