Finding String in Variable Name

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Message
Author
Squashman
Expert
Posts: 4486
Joined: 23 Dec 2011 13:59

Re: Finding String in Variable Name

#16 Post by Squashman » 09 Dec 2014 21:47

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.

Samir
Posts: 384
Joined: 16 Jul 2013 12:00
Location: HSV
Contact:

Re: Finding String in Variable Name

#17 Post by Samir » 09 Dec 2014 21:59

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. 8)

Thank you all for the help!

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: Finding String in Variable Name

#18 Post by foxidrive » 09 Dec 2014 22:02

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. 8)

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.

Samir
Posts: 384
Joined: 16 Jul 2013 12:00
Location: HSV
Contact:

Re: Finding String in Variable Name

#19 Post by Samir » 09 Dec 2014 22:29

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 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.

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. :D

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: Finding String in Variable Name

#20 Post by foxidrive » 10 Dec 2014 02:18

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.

Samir
Posts: 384
Joined: 16 Jul 2013 12:00
Location: HSV
Contact:

Re: Finding String in Variable Name

#21 Post by Samir » 22 Dec 2014 02:17

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.
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.

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.

Post Reply