Your Answer


Windows batch file IF failure - How can equal ? Any help will be appreciated. Thanks for your suggestions. You just need to add 1 or more non digit characters to both sides of the condition. Now we are trying again to get past this so we can move to Windows 7 again.


The simplest solution is to determine the maximum number of digits you need to support - let's say 15 for this example. So you prefix each value with 15 zeros, and then preserve only the right-most 15 characters by using a substring operation. You also need to add a non-digit to both sides as before - again quotes work well.

You can later remove the leading zeros whenever you want using the following or adapt to remove leading spaces. Normally we don't deal with large numbers in batch files. But they can easily crop up if we look at free space on a hard disk. Terabyte disk drives are now relatively inexpensive. This is how I first ran into comparison of large numbers at https: I chose to support 15 digits in my example because that equates to almost terabytes. I imagine it will be a while before we have to deal with disk drives larger than that.

IF actually supports negative numbers, as well as hex and octal notation. See Rules for how CMD. EXE parses numbers for a much more thorough explanation. By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service , privacy policy and cookie policy , and that your continued use of the website is subject to these policies.

Windows batch file IF failure - How can equal ? IF gives the wrong answer when I try to compare 2 large numbers. Numeric comparison is done if both sides are well-formed numbers -- not just strictly decimal digits. I struggled coming up with a concise explanation that would not overwhelm the point about large numbers being treated as the max allowed integer.

More info is available at Rules for how CMD. PaulH - I've addressed your point with an edit at the end. Don't mean to be nitpicky but I've been bitten recently by "strictly decimal digits" -- having leading zeroes and expecting a numeric comparison. I've always truly disliked the support of octal be it C or CMD or any language via a leading zero on a multi-digit numeric.

In the requester where you select a User or Group just type: Not a solution for your problem, but it might get you closer to a solution If you post the results from Procmon, I may be able to amend this answer to be more helpful.

Hi David, I added the Process Monitor. Process Name is w3wp. That sounds like you just don't have a web. I would check two things. See if it's requesting unusual rights.

Does the app use impersonation level security? If so, then the user of the app needs access to that key too. You can add the necessary rights for "Everyone". Note that there will probably be additional keys under TypeLib and Interface that you'll have to change. It will likely require multiple sessions with procmon to find everything. Here's what I did: Clean install of Windows 7 Professional 64 bit, SP1. Utils" that adds two input numbers, and returns the result. The install location is the default web application location C: I will try registering it in either or both ways.

Maybe something so simple will lead to better understanding of this problem. Hey Chue, I simply registered with regsvr32 and it worked. I will try unregistering and then using the Component Manager. Thanks for your help. I will try increasing the complexity of this simple COM object until it is like the one that fails always. That should let me understand better. Peter Ruderman 8, 21 Thank you Peter, I tried that earlier.

CreateObject statement it returned the following error: Negarrak 1 7. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Post Your Answer Discard By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service , privacy policy and cookie policy , and that your continued use of the website is subject to these policies.