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

  • Home
  • SEARCH
  • 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 6765621
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:44:02+00:00 2026-05-26T14:44:02+00:00

not seem to getting the outputs from exec() command in PHP, OS: Windows XP

  • 0

not seem to getting the outputs from exec() command in PHP, OS: Windows XP

here’s the code used:
exec(“echo %username%”,$output);

using print_r($output) which returns 1;

  • 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-26T14:44:02+00:00Added an answer on May 26, 2026 at 2:44 pm

    echo is not a program on Windows that you can call. It is a feature provided specifically by the command processor (i.e. cmd.exe).

    If you want the username in this manner don’t start up a shell. Use getenv instead.

    (If for some reason you wanted to use echo you would need to do cmd.exe /c echo Whatever. Also note that checking the return code as well as the output may be useful)

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

Sidebar

Related Questions

In one of our application im getting an exception that i can not seem
This code does not seem to compile, I just need to write something to
Serialized varibale does not seem to retain its state from classes that were extended.
I've been working on getting a Coefficient of Variation equation ported from PHP to
This is soooo weird. I cannot seem to get any output messages from Sys.Debug
I cant seem to figure out why I keep getting this buggy output. Input
CLR profiler does not seem to work with the Silverlight CLR. Does another memory
This question might not seem programming related at first, but let me explain. I'm
Excel macros do not seem to allow the use of undo after running them.
A using declaration does not seem to work with an enum type: class Sample{

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.