Finding String in Variable Name
Moderator: DosItHelp
Re: Finding String in Variable Name
There is no logical sense to have a GOTO statement to the MAP label when it is the next command. Batch process sequentially line by line. It executes each line before moving onto the next unless you use a GOTO to skip over lines of execution.
Re: Finding String in Variable Name
Using everything in this thread, I was able to get what I wanted to work.
The issue was not using CALL preceding the exe to start the program. Problem solved.
Thank you all for the help!
The issue was not using CALL preceding the exe to start the program. Problem solved.
Thank you all for the help!
Re: Finding String in Variable Name
Samir wrote:Using everything in this thread, I was able to get what I wanted to work.
The issue was not using CALL preceding the exe to start the program. Problem solved.
Thank you all for the help!
You may have solved the problem Samir, and you have an idea of how you solved it, but a simple exe file NEVER needs a call statement.
You may disagree, you may not reply, this post is purely in the interests of discussion - not to just say that you are mistaken.
Re: Finding String in Variable Name
I agree that what I have running isn't the most elegant or correct, but for now it works. When I have more time I definitely plan to clean it up.foxidrive wrote:You may have solved the problem Samir, and you have an idea of how you solved it, but a simple exe file NEVER needs a call statement.
You may disagree, you may not reply, this post is purely in the interests of discussion - not to just say that you are mistaken.
I also don't really understand why the exe needed CALL in front of it either. I never needed it for a previous, more simple batch file that ran the program. Using CALL was just a hunch as I was initially going to use START since this is an xp command prompt after all.
All I can guess is that it's an old DOS program that is somehow not playing nice with an environment it never expected to run in. I'm sure there's a real reason to why it's working and wasn't working before, but unless it's a fundamental issue, I don't think it will do any harm for now. I would love to hear the theories though.
Re: Finding String in Variable Name
Samir wrote:All I can guess is that it's an old DOS program that is somehow not playing nice with an environment it never expected to run in.
Just commenting here that that is something that wasn't revealed about the task.
I often argue with question-writers about how they should discuss the real task, as it's not our job to drag details of the task out of them.
In this case too, the task is largely unknown - and is like you visiting the dentist to get your tooth fixed, but you won't tell the dentist which tooth hurts.
At least the Dentist can examine your teeth and tell for themselves.
We don't know what exe file it was and how it is being launched, and what else is in the batch file so the answer will remain unknown.
Re: Finding String in Variable Name
There has never been an issue running this exe inside a batch either in DOS or XP command prompt before, so it will be next to impossible to determine why it decided to stop working normally.foxidrive wrote:Samir wrote:All I can guess is that it's an old DOS program that is somehow not playing nice with an environment it never expected to run in.
Just commenting here that that is something that wasn't revealed about the task.
I often argue with question-writers about how they should discuss the real task, as it's not our job to drag details of the task out of them.
In this case too, the task is largely unknown - and is like you visiting the dentist to get your tooth fixed, but you won't tell the dentist which tooth hurts.
At least the Dentist can examine your teeth and tell for themselves.
We don't know what exe file it was and how it is being launched, and what else is in the batch file so the answer will remain unknown.
The batch was checking to see if it being executed on a particular computer to map or not map a drive before running a program. That one program has an exec to start it. I don't see what other information was necessary. The exe never required anything special to execute before, so that is a little bit outside the assistance with the batch itself imo.