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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T10:58:59+00:00 2026-06-05T10:58:59+00:00

I have a C++ command line program compiled with Microsoft Visual Studio 2003, and

  • 0

I have a C++ command line program compiled with Microsoft Visual Studio 2003, and I am running the resulting 32 bit executable under Windows 7 (64 bit version). Most things work correctly except for one baffling oddness.

On startup, my program attempts to read a text file using and ifstream. If I run my program as an Administrator, either by opening an Administrator command prompt, or right clicking in Explorer and selecting “Run As Administrator”, then everything works fine and my program reads the current version of the file.

If instead, I run from a normal command prompt, or by double clicking in explorer, my program instead sees an older version of the text file from yesterday. Even if I delete the file, my program still happily opens the file and reads out the old contents.

If I run type or notepad on the file in non admin mode, the correct newest version displays, the problem appears limited to my program. I’ve tried giving every possible permission to the file to my user without any change.

One possible clue is that if I go to properties on the text file from Explorer and look under “Previous Versions”, there is one previous version listed, from yesterday, and it’s contents are identical to what my program is seeing when it tries to read the file.

Somehow my program appears to be stuck in an old view of the filesystem when running not as an administrator and is seeing this previous version instead, and am hoping someone can explain to me why this is happening and (hopefully) how to fix it.

  • 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-05T10:59:01+00:00Added an answer on June 5, 2026 at 10:59 am

    If you are not using an absolute pathname for the input file, then you are likely reading the wrong file (evidenced by the fact that you can read the file after you delete it). In other words, there’s another copy of the old file somewhere on your system, and that’s what your program is reading.

    Microsoft’s ProcMon tool (or the older FileMon) can show you which file is being accessed by your application.

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

Sidebar

Related Questions

I have a console program on windows (a compiled version of curl command line)
I have a simple little command-line program, written in C#, running under .NET 4.0,
I have an Android activity where I'm executing NDK compiled code (command line program)
I have a CGI script (compiled C program) that outputs its command line arguments
I have compiled a C program in BASH which requires command line arguments. However,
Hypothetical situation. I have a command line program in *nix (linux, BSD, etc.). It
Say I have a command line C program which is currently executing, and I
I have the below command line arguments set for the program. argument proc is
I have a program which runs an external, command line utility and reads the
I have an old, third party, command line, proprietary program which I'm calling from

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.