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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T02:45:33+00:00 2026-06-01T02:45:33+00:00

Can this be done? Basically I work on multiple projects using xampp, and I

  • 0

Can this be done?

Basically I work on multiple projects using xampp, and I like http://localhost to be the project root ( rather than http://localhost/project_name/ )

Problem is, i have to open the httpd.conf file in the apache folder, change the document root, then restart apache!

I was wondering if this could be done in ms-dos?

say I write a batch file that:

opens the file,
finds the document root,
changes it,
stop apache,
start apache

Then all i would need to do is open the cmd prompt, and write:

http_change.bat new_project_name

Problem is, I only know basic ms-dos and examples and tuition on the web are surprising hard to understand!

EDIT

I’m Really struggling with this so im offering a bounty.

so far i’ve tried:

for /f "eol=# tokens=* delims=*" %%a in (httpd.conf) do echo %%a

this successfully reads the file, but then i tried

for /f "eol=# tokens=* delims=*" %%a in (httpd.conf) do (
    echo %%a
)

and that worked. then

for /f "eol=# tokens=* delims=*" %%a in (httpd.conf) do (
    set line=%%a
    echo %line%
)

and that failed… it just echoed “ECHO is off.” which makes me assume the it isnt setting the line variable…

my plan was to check each line to see if the first 12 characters == “DocumentRoot” and if they do, rather than saving the line to a new file, i modify the line using sting manipulation and save that instead…

  • 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-01T02:45:34+00:00Added an answer on June 1, 2026 at 2:45 am

    You’re causing yourself unnecessary grief by trying to edit the configuration file. Here’s a better idea:

    • Remove the DocumentRoot setting from your httpd.conf file. Replace it with an Include directive, something like:

      Include \path\to\documentroot.conf
      
    • Now instead of editing a file you simple replace the documentroot.conf file, which contains a single line of the form:

      DocumentRoot \path\to\my\documentroot
      

    And here’s another idea:

    You can pass Apache configuration options on the command line with the -C directive (or -c, depending on whether you want your directive applied before (-C) or after (-c) Apache reads its configuration files). So as with the previous idea, remove the DocumentRoot directive from your httpd.conf, and then when you restart httpd, start it like this:

    httpd -C 'DocumentRoot \path\to\my\documentroot'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm basically work with Middleman 2 though if this can only be done in
The title basically says it all. I'm aware this can't be done using traditional
Can this be done? It seems like this should be possible. In general, I
I know this can be done and i have seen it done using some
I understand that this can be done at release using the maven-gpg-plugin. However, I
Can this be done in JavaScript? type == 1 ? function1() : function2();
How can this be done more elegant and without creating new objects? List<Move> playerMoves
Sure I've seen this done before but off-hand I can't find any examples. I've
I am wondering if this can be done easily. I am doing some paypal
Simple question. Just wondering if this can be done without me having to enforce

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.