Click here to Skip to main content
15,306,017 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I have a VB.Net application called GliderScore.
I can compile and run the program using VS2022 in both debug and release mode.

I need the executable to be run from a different folder called c:\gliderscore6.
So, I copy gliderscore.exe from the \bin\release folder and paste in the folder called c:\gliderscore6.
The program will not run from c:\gliderscore6.

What I have tried:

I have tried running as administrator with the same result.

I have tried on two other computers. A W10 machine and a W11 machine.
In those instances the program ran perfectly.

The issue seems to be restricted to my development machine on W11.

I have discovered that if I rename the copied executable from gliderscore.exe to gliderscore1.exe then the program will run. This should be a clue as to what is happening but it doesn't make sense to me.

Renaming the copied executable back to gliderscore.exe results in the program not running.

Any help would be appreciated.
Posted
Updated 10-Dec-21 14:25pm
Comments
Richard MacCutchan 10-Dec-21 4:32am
   
You need to provide more information about what happens when you try to run it. But you should not be putting applications in the root of the C: drive. You should use a folder in "C:\Program Files" or "C:\Program Files (x86)" as appropriate, or somewhere in the users "AppData\Local|Programs" folder.
Dave Kreskowiak 10-Dec-21 8:05am
   
Without knowing anything about what your code is supposed to be doing, what is should be doing, and any error messages, it's impossible for anyone to tell you what's going on.
Gerry Carter 10-Dec-21 17:15pm
   
Thanks for your comment Richard,
It may not be best practice to put the application in the root of the C drive. But does it do any harm?

Dave,
I thought that the issue is pretty clear.
A program called gliderscore.exe fails to run.
When the name is changed to gliderscore1.exe (nothing else is changed) the program runs.
What can cause that to happen?

We can't help you: we have no idea what you code is doing, or what it expects to happen.

It's entirely possible that it's a "permissions thing" - so start by checking that the user has read and execute rights on the folder.

Then, use exactly the same procedure you used to "install" your app on the second machine to install it on your dev machine, and use the same procedure to use to run it on both.
Does it behave differently? If it does, it's either environmental (permissions, missing files, wrong user, ...) or it needs a "proper" installation.

I'd try using a proper installer to move the application: it should deal with all the details for you, as well as putting it in the "right place" for executables.
   
You can use SysInternals to try to find out what is happening Sysinternals Process Utilities - Windows Sysinternals | Microsoft Docs[^]. This is a free tool from Microsoft - in particular I would start with Process Explorer and Process Monitor
   
Thanks for the help provided.

After taking a few steps the problem has resolved.

The program saves a lot of settings (Project=>Properties=>Settings) for re-use each time the program is run.

There appears to have been some corruption in the settings file (this is located in folder c:\UserName\AppData\Local\GliderScore).

If this folder is not present when the program starts, the folder is rebuilt with the default values of all of the settings. The folder takes its name from the program name.

The solution was to delete the folder c:\UserName\AppData\Local\GliderScore and then run the program.

The result was that the program ran perfectly.

The reason why renaming gliderscore.exe to gliderscore1.exe worked is that, because of the new executable file name a new settings file (named ....\gliderscore1) was generated.
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900