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 5962183
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T19:04:12+00:00 2026-05-22T19:04:12+00:00

Possible Duplicate: What is the Windows version of cron? Hi everyone, I’m having a

  • 0

Possible Duplicate:
What is the Windows version of cron?

Hi everyone,

I’m having a script.php on IIS server and I want to call that script automatically every x minutes. The problem is that I need to pass arguments to the script like I would do in the browser (script.php?task=aaa). it seems that scheduled task ignores argument ?task=aaa…

How can I run this script passing it some “GET” arguments?

Thanks,
L

  • 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-05-22T19:04:13+00:00Added an answer on May 22, 2026 at 7:04 pm

    You can pass parameters into the file by invoking it like so:

    C:\PHP5\php.exe -f "C:\PHP Scripts\script.php" -- -arg1 -arg2 -arg3
    

    and then you can parse argv with this function:

    function arguments($args ) {
        $ret = array(
            'exec'      => '',
            'options'   => array(),
            'flags'     => array(),
            'arguments' => array(),
        );
    
        $ret['exec'] = array_shift( $args );
    
        while (($arg = array_shift($args)) != NULL) {
            // Is it a option? (prefixed with --)
            if ( substr($arg, 0, 2) === '--' ) {
                $option = substr($arg, 2);
    
                // is it the syntax '--option=argument'?
                if (strpos($option,'=') !== FALSE)
                    array_push( $ret['options'], explode('=', $option, 2) );
                else
                    array_push( $ret['options'], $option );
    
                continue;
            }
    
            // Is it a flag or a serial of flags? (prefixed with -)
            if ( substr( $arg, 0, 1 ) === '-' ) {
                for ($i = 1; isset($arg[$i]) ; $i++)
                    $ret['flags'][] = $arg[$i];
    
                continue;
            }
    
            // finally, it is not option, nor flag
            $ret['arguments'][] = $arg;
            continue;
        }
        return $ret;
    }//function arguments
    

    Source: http://php.net/manual/en/features.commandline.php

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

Sidebar

Related Questions

Possible Duplicate: Windows API and .net languages I want to call native Windows API
Possible Duplicate: Which version of Perl should I use on Windows? I want to
Possible Duplicate: Writing a Windows system tray application with .NET I want to develop
Possible Duplicate: Accessing Windows registry with PHP and DOTNET class Is there a way
Possible Duplicate: adding media element in windows phone 7? I Want Details Explanation and
Possible Duplicate: How to get the current OS version of Windows Phone? How to
Possible Duplicate: read/write to Windows Registry using Java I want to read the registry
Possible Duplicate: Java Serial Communication on Windows Friends, I want to connect and transfer
Possible Duplicate: /dev/null in Windows? I have a complex code that encodes input file
Possible Duplicate: Best C++ IDE or Editor for Windows Hello, everyone. For a long

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.