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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T04:12:19+00:00 2026-05-19T04:12:19+00:00

I got a quite long windows batch script. In the middle of it there’s

  • 0

I got a quite long windows batch script. In the middle of it there’s a section using appcmd to detect the root path of a site in my IIS. That section runs fine when executed standalone. But when I execute the whole batch, this section could fail to detect the site path once in a while. I am totally confused by this unreliability issue. Have anyone met this before?

Thanks

Solution

It seems that there’s some delay between a variable declaration and its coming into effect. I changed the order of some part of the batch file and it runs fine so far. I must say, it’s still weird.

  • 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-19T04:12:20+00:00Added an answer on May 19, 2026 at 4:12 am

    As I don’t know what type of problem you have in your unknown code, I can only show the known unpredicable or random behaviour in batch-files.

    1- multiple tasks echo of line ends
    Sometimes but not always the linefeeds and carriage returns are print as the ASCII-Chars 10/13 (a circle and a note) instead of begin a new line.

    @echo off
    if "%1"=="/second" (
      call :task %2
      goto :eof
    )
    (call "%~0" /second 1 >con ) | ( call "%~0" /second 2 )
    echo END OF TASKS
    goto :eof
    
    :task
    for /L %%n IN (1,1,10) DO (
        echo This is task%1, output no %%n
        ping -n 2 localhost > nul
    )
    
    goto :eof
    

    2- Sometimes but not always an expansion of %~^LF crashes, then the command window closes immediatly.

    @echo off
    set critical_content=hello%%~^
    
    echo No crash
    for %%a in (1 ) do (
        for %%x in (4) do (
            rem #%critical_content%#
        )
    ) 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have got quite a long way with this. I want a WCF service
I've got a query (it's quite long, but here's the gist of it) Name.find_by_sql(['SELECT
I've got quite a few SQL statements like such: SELECT foo FROM things WHERE
This unix command I haven't got quite working on Mac yet - any ideas
I'm designing an MVC site, and I've already got quite a few things in
Yep -- the title pretty much sums it up. I've got quite a few
I've got a quite strange problem here. I'm calling some simple code via Ajax.Updater:
I have the 2 following LINQ queries and I haven't quite got my head
It is quite possible that I may not have got the point, but I
I've got a function I wrote quite some time ago that works fine, but

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.