Problem running batch script in command prompt

tdhumal
tdhumal used Ask the Experts™
on
Hi Everyone,

I am running similar batch script on 2 different PC's. It works on one and does not work on other. Any idea why command prompt behave different?

Thanks,
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Can you please post the two scripts you running so that we can help you?

Author

Commented:
I will post them in few minutes

Commented:
Two suggestions - the scripts, and more points :-)
Exploring ASP.NET Core: Fundamentals

Learn to build web apps and services, IoT apps, and mobile backends by covering the fundamentals of ASP.NET Core and  exploring the core foundations for app libraries.

Author

Commented:
The scripts are same and the script works good in one PC and does not on other.
Unfortunately I cannot post the script. I even compared the script on both PC's. They are identical, but it does not work on on PC.

Is there any setting issues with command prompt??
Just wanted to get some ideas

Commented:
The idea with seeing the script is knowing what to aim for.... are the PC's the same OS, do they have the same PATH variable, is the script referring to any other files, exe's.  Do the users have the same NTFS or share rights, are the TEMP variables going to the same place.  Do they have the same network drives mapped?   Are CD / hard / flash drives given the same letters.... All or none of which may be relevant depending upon what the script is doing you see.

Author

Commented:
Thanks for your reply. I can check the OS and PATH values of the PC where the script does not work.
That is the only things which can be different.

I can post my findings tomorrow after 11:00am eastern time
Ben Personick (Previously QCubed)Lead SaaS Infrastructure Engineer

Commented:
You need to post the script.  Commands have different switches that are valid under different operating systems and sometimes even different behaviors under different operating systems.

We need to see what commands you are running, how you are parsing their output, what switches you are using, and know which operating systems you are running on in order to help you.

ALSO you are being very stingy with the points you have no limit of points you should increase the point value of this question to 500.
Test your restores, not your backups...
Top Expert 2016
Commented:
Can you explain what "does not work" means on the PC you have a problem with?  Do you see an error?  Does something happen or not happen that is wrong?

You could try removing the ECHO OFF at the top of the script before running it from a command shell, and see what it displays, might give you some clues.

~bp

Commented:
Hi,

If you are not able to post the script, atleast let us know what result are you in search of..
This can help us in helping you.

Commented:
:-)
Hi tdhumal

f your batch files contain some confidential information, would it be possible to maybe replace the confidential parts of the batch files with some non-confidential words or names and attach them as *.txt files.

It would be very, very useful for us to see the scripts rather than just making guesses about what could be wrong.

Bill
Bill PrewTest your restores, not your backups...
Top Expert 2016

Commented:
@BillDL

:-)

~bp

Author

Commented:
echo off helped me get my problem fixed
Bill PrewTest your restores, not your backups...
Top Expert 2016

Commented:
Great, glad that helped you get it sorted out.

~bp

Author

Commented:
Thanks to all the other responders. I really appreciate it

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial