swap567 Posted March 2, 2009 Share Posted March 2, 2009 Hi I just want a know if it's posible to execute a ms-dos script from a php page thx Quote Link to comment https://forums.phpfreaks.com/topic/147606-ms-dos/ Share on other sites More sharing options...
premiso Posted March 2, 2009 Share Posted March 2, 2009 If on a windows system, yes. Using system / exec and the script is locally on the server. Quote Link to comment https://forums.phpfreaks.com/topic/147606-ms-dos/#findComment-774889 Share on other sites More sharing options...
swap567 Posted March 2, 2009 Author Share Posted March 2, 2009 Ok and if I'm using a Linux server but viewing the page on windows?? a saw thing like shell_exec() is that ok?? Quote Link to comment https://forums.phpfreaks.com/topic/147606-ms-dos/#findComment-774893 Share on other sites More sharing options...
genericnumber1 Posted March 2, 2009 Share Posted March 2, 2009 You can't execute a ms-dos script on a unix server (without third party applications), just as you can't execute bash scripts on a windows server (without third party applications). What operating system the visitor is using has no bearing on the script's execution because php is server-side. Which script are you trying to execute? There may be a unix variant. Quote Link to comment https://forums.phpfreaks.com/topic/147606-ms-dos/#findComment-774898 Share on other sites More sharing options...
swap567 Posted March 2, 2009 Author Share Posted March 2, 2009 I want to copy a small program that I made with a .exe and that is on a data server only to the c:\temp and execute it so the visitor can see my application I know that maybe for some security we can't do this but maybe and I just want to try. I AM NOT A HACKER THAT FOR MY JOB Quote Link to comment https://forums.phpfreaks.com/topic/147606-ms-dos/#findComment-774910 Share on other sites More sharing options...
genericnumber1 Posted March 2, 2009 Share Posted March 2, 2009 You would need to have a user download the file and execute it on their system themselves, there's not supposed to be a way you can do it automatically. I'd also advise distributing the source along with the binaries so your customers can have peace of mind if that's something you're willing to do. Quote Link to comment https://forums.phpfreaks.com/topic/147606-ms-dos/#findComment-774915 Share on other sites More sharing options...
swap567 Posted March 2, 2009 Author Share Posted March 2, 2009 Ok if I can't do this... I have an other question because I tried to do it all in php before doing my application i just need to verify in the server data something like \\servername\folder\...... if the file I'm searching exist. with the function fileExist(file_name) if I try to put the path directly the php return me nothing Quote Link to comment https://forums.phpfreaks.com/topic/147606-ms-dos/#findComment-774924 Share on other sites More sharing options...
genericnumber1 Posted March 2, 2009 Share Posted March 2, 2009 If you use backslashes you have to escape them. <?php file_exists('\\\\servername\\folder\\anotherfolder\\file.whatever'); Quote Link to comment https://forums.phpfreaks.com/topic/147606-ms-dos/#findComment-775003 Share on other sites More sharing options...
swap567 Posted March 3, 2009 Author Share Posted March 3, 2009 I tried all those thing but still give me that the folder don't exist. never mind... Thanks for your help buddy really appreciate I will continu to work on that Quote Link to comment https://forums.phpfreaks.com/topic/147606-ms-dos/#findComment-775461 Share on other sites More sharing options...
HuggieBear Posted March 3, 2009 Share Posted March 3, 2009 The server can't see anything on the client regardless of the OS. Are you saying that from php (server) you want to be able to see the contents of a users c:\temp directory (client) for example? If so then it can't be done with PHP. Quote Link to comment https://forums.phpfreaks.com/topic/147606-ms-dos/#findComment-775467 Share on other sites More sharing options...
swap567 Posted March 3, 2009 Author Share Posted March 3, 2009 No I want to be able to see the content of another server (data server only) But I can see if the content exist but I can link to the content if I know that he exist. So I just want to have a way to verify if the content exist. After I can show it no problem. Do you have an other way (other than php) to see the content of an other source?? I can change my application an write it in an other language.... thx Quote Link to comment https://forums.phpfreaks.com/topic/147606-ms-dos/#findComment-775486 Share on other sites More sharing options...
HuggieBear Posted March 3, 2009 Share Posted March 3, 2009 OK, I think we're getting somewhere. How do you access files on the data server. Does the webserver have access to the data server on the network. Is the data server an FTP server/web server? Quote Link to comment https://forums.phpfreaks.com/topic/147606-ms-dos/#findComment-775497 Share on other sites More sharing options...
swap567 Posted March 3, 2009 Author Share Posted March 3, 2009 No the webserver don't have access to the data server for information: the webserver is a linux server. And I don't think that the data server is an FTP server/web Quote Link to comment https://forums.phpfreaks.com/topic/147606-ms-dos/#findComment-775757 Share on other sites More sharing options...
trq Posted March 3, 2009 Share Posted March 3, 2009 No the webserver don't have access to the data server There lies your problem. No matter what language you use funilly enough if you want access to the data, you need access to the data. Quote Link to comment https://forums.phpfreaks.com/topic/147606-ms-dos/#findComment-775760 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.