Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8638347
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T10:42:23+00:00 2026-06-12T10:42:23+00:00

I work with PHP 5.4 , IIS 7.5 . If execute a simple command,

  • 0

I work with PHP 5.4, IIS 7.5.

If execute a simple command, it works:

<?php
    exec("dir", $r);
    print_r($r);
?>

But if open .exe file, it doesn’t work, the page is loading until the php timeout and doesn’t open the notepad:

<?php
    exec("notepad.exe", $r);
    print_r($r);
?>

And if execute the notepad’s php in command line, it works:

php -f <file>

I think that the problem is with IIS, but I don’t know what. Thanks!

UPDATE

I did another test case and doesn’t work, the page finishes loading but doesn’t delete the task:

<?php
    $r = exec("SCHTASKS.exe /Delete /TN TaskTest /F");
    print_r($r);
?>

The IIS_IUSRS have permission for execute the schtasks.

SOLUTION

Notepad doesn’t open because is a interactive program.

For Tasks scheduler, gives read and write permissions to the task folder (C:\Windows\System32\Tasks) to IUSR.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T10:42:25+00:00Added an answer on June 12, 2026 at 10:42 am

    What makes you think it isn’t working?

    Be aware that windows services cannot normally interact with the desktop, so it may be the case that notepad is starting, just not anywhere you can see it – and as PHP will wait for it to terminate, and nobody can see it to terminate it, it’ll timeout, as you’re seeing.

    It may also be the case that the user that the web server is running as does not have execute permissions on the folder that notepad is in (assuming it had the relevant path).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Ok it does work in PHP but if I modify the file so that
I'm trying to upload a file but i doesnt work: Usefull Info: Running IIS
In my .htaccess file i have the following re-write rule RewriteRule ^([a-z]*)$ work.php?album=$1 [L]
My text editor of choice for PHP work is Panic's Coda. But for Ruby
This kind of code would normally work in PHP, but since the scope is
Possible Duplicate: How to read Windows loged in username with PHP/IIS I'm work on
Hey, I am using PHP 5.3 on IIS 7 (express) and planning to work
Hi I have the following script which works fine running on IIS but when
I have set up PHP5.3, MySQL5.1, and IIS7 on Window 7 but php doesn't
Why does some query that works in mysql doesn't work with db_query? For instance

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.