Jump to content

Exec .bat file not working?


kekec777

Recommended Posts

Hallo forum

 

Im runing IIS 8.5 (windows 8.1) and i want to execute a .bat file on my windows 8.1 from my home page..

 

So i create a link that opens test.php:

And here i want to call my test.bat (test.php and test.bat is located in the same folder)

test.bat content (tried all these options)

system('c:\WINDOWS\system32\cmd.exe /c C:\inetpub\www.kekec.dk\include\test.bat');

system('test.bat');
exec('c:\WINDOWS\system32\cmd.exe /c C:\inetpub\www.kekec.dk\include\test.bat');
exec('test.bat');
shell_exec("C:\windows\system32\cmd.exe /c test.bat");
shell_exec('test.bat');

 

My test.bat files content is (only for test):
%SystemRoot%\explorer.exe

 

This should open explorer on the host but what i managed to get is only the output:

C:\inetpub\www.kekec.dk\include>C:\Windows\explorer.exe 

 

please advise (and just to mention that im executing with my admin user from test.php- after i have logged in to my web-page)

Link to comment
https://forums.phpfreaks.com/topic/294744-exec-bat-file-not-working/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.