Recommended Posts

So I've got PHP running under IIS on a server 2012 R2 machine and I want to do some scheduled task configuration from within a PHP script. So by default IIS uses the IUSR account, so I've created a virtual application and set it to use a different app pool which I've set to use the administrator acount for testing (please do not reply with 'why would you do this' or 'thats insecure' - I really couldn't care less). So I'm trying to run schtasks.exe using PHP but it doesn't seem to work. I thought by using the the administrator account it'd have execute access to all the system files but I'm not sure? There should be some output from the schtasks command as to if it was successful or not but I am just given an empty array by execute(). I'm assuming this is a problem with the IIS configuration.

Any ideas?

If you want to run a php script from a scheduled task, why involve IIS at all? Just find the path to the php executable, and run that from the scheduled task, passing in the path of the php script you want it to run.

  On 19/08/2016 at 10:48, DaveLegg said:

If you want to run a php script from a scheduled task, why involve IIS at all? Just find the path to the php executable, and run that from the scheduled task, passing in the path of the php script you want it to run.

Expand  

I think he wants to do it the other way around, run schtasks from inside a PHP script.

  On 19/08/2016 at 10:49, Danielx64 said:

I think he wants to do it the other way around, run schtasks from inside a PHP script.

Expand  

Ahh, yes, now I read it again, I see that :)

 

Check that you're passing the full path to the executable you want to run, not just the name of the exe file

Hmm OK so it doesn't seem to like me passing parameters using exec(). I've got it outputting a command list (ran with no parameters) when I run it from the normal IIS directory but when I run it from the virtual directory that is my administrator user I still get no output

This topic is now closed to further replies.
  • Posts

    • ICYMI: 4TB Corsair MP700 PRO SE SSD is still selling at its lowest price by Fiza Ali Amazon US and Newegg are still offering the 4TB Corsair MP700 PRO SE solid-state drive at its new lowest price. The MP700 PRO SE is an M.2 2280 SSD that employs a PCIe 5.0 ×4 interface with NVMe 2.0, delivering sequential read speeds of up to 14,000MB/s and sequential write speeds of up to 12,000MB/s. It uses high-density 3D TLC NAND and carries a Total Bytes Written (TBW) rating of 3000. Furthermore, the drive can withstand vibration from 20Hz to 80Hz at 1.52mm and 80Hz to 2000Hz at 20G, as well as shocks up to 1500G. The drive incorporates AES 256-bit encryption and supports Microsoft DirectStorage, allowing compatible games to load assets directly to the GPU for reduced load times. Moreover, it operates within a temperature range of 0°C to +70°C, and can be stored between –40°C and +85°C at up to 93% relative humidity (40 °C). A heatsink is not included, so users must provide their own or rely on a motherboard’s integrated SSD cooling solution to maintain optimal thermals. Finally, the MP700 PRO SE is compatible with Windows 10, Windows 11, and macOS systems that provide an M.2 slot, and communicates via a standard M.2 2280 interface connector. 4TB Corsair MP700 PRO SE SSD: $549.99 (Amazon US) 12% off - $549.99 (Newegg) 9% off This Amazon deal is US-specific and not available in other regions unless specified. If you don't like it or want to look at more options, check out the Amazon US deals page here. Get Prime (SNAP), Prime Video, Audible Plus or Kindle / Music Unlimited. Free for 30 days. You can also check out other SSD deals here. For hard disk drives, you can head over to our HDD deals section to see if anything from there matches your requirements. Make sure you also browse through Amazon US, Amazon UK, and Newegg US to find some other great tech deals. As an Amazon Associate, we earn from qualifying purchases.
    • "requiring individual licences from all rights-holders would impose an unmanageable administrative burden and could deter AI investment in the UK." Ah so plebs (humans) will forever be required to secure license, but AI should get a broad pass because it's too complicated. Not so "intelligent" after all? Plus, every opt out I have signed regarding Meta using my data was never presented to me in a clear way, I had to discover it here on neowin or some other news site with a link to do it. So what the government is saying is that they prefer to offer an opt out just to cover their asses, but good luck us plebs finding such a thing!
    • The look speaks volumes, doesn't it?  
    • Whatever happened to offering a desirable product is what lead to profit?
  • Recent Achievements

    • First Post
      ClarkB earned a badge
      First Post
    • Week One Done
      Epaminombas earned a badge
      Week One Done
    • Week One Done
      Prestige Podiatry Care earned a badge
      Week One Done
    • Week One Done
      rollconults earned a badge
      Week One Done
    • Week One Done
      lilred1938 earned a badge
      Week One Done
  • Popular Contributors

    1. 1
      +primortal
      134
    2. 2
      Xenon
      129
    3. 3
      ATLien_0
      123
    4. 4
      +Edouard
      102
    5. 5
      snowy owl
      96
  • Tell a friend

    Love Neowin? Tell a friend!