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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T20:39:58+00:00 2026-05-12T20:39:58+00:00

One of the ways our app is distributed (on Windows) is as a ZIP

  • 0

One of the ways our app is distributed (on Windows) is as a ZIP archive. Inside this archive is a batch file used for starting the app. The user is supposed to unzip the archive before running our app, but frequently users ignore our instructions and try to run the app without unzipping the archive first. When users do this, the app fails to start, but it’s not obvious (to the user) exactly what caused the failure. We’d like to detect from within the batch file whether it’s being run from inside a ZIP archive, and if so, show the user a message reminding him to unzip the archive first.

However, it’s not clear at all to me how to detect this condition. While the batch variable %cmdcmdline% contains the command which ran the batch file, there seems to be no way to use the path to reliably tell whether the path points into a ZIP archive. For example, I put the following batch file, named test.bat, into a ZIP archive:

echo %cmdcmdline%
pause

The output, when run from within the archive, was:

cmd /c ""C:\Users\liana\AppData\Local\Temp\Temp1_test.zip\test.bat" "

Now, it seems likely that Temp1_test.zip is a ZIP archive, not a real directory, but there’s no guarantee that it is. Clearly, Windows knows how to tell the difference, so there must be some more reliable way than simply checking whether “.zip” shows up in the path somewhere. But how?

  • 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-12T20:39:58+00:00Added an answer on May 12, 2026 at 8:39 pm

    Your program isn’t actually being run from “Within” the archive. The archive is first expanded out to a temporary directory (The location for which can vary depending on which archiving tool is being used), before being run.

    With this in mind it becomes clear that it isn’t ever possible to tell for sure one way or another, so perhaps the best thing to do is instead to check for the presence of the other files you need to run your program, relative to the batch file’s location.

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

Sidebar

Related Questions

I have a .bat file in a Windows machine that starts our program by
I am building a simple app monitor to poll one of our API URLs
I've tried a few ways of doing this, the problem is our site is
We have an internal error reporting system (inside our functions dll) and one of
I was asked in an interview to enlighten the ways one can use to
I'm new to VB.NET programming. What I'm confused about is the different ways one
I can write an assertion message one of two ways. Stating success: assertEquals( objects
Let's say my HTML may look one of two ways: Option 1: <h2>My header
I know that we can initialise an array in one of two ways: Loop
ETags , as I read about, is one of the ways to implement the

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.