1.

Solve : HELP... how do i code a % within my command. ??

Answer»

Hi all,
just joined, looks like fantastic site.
I need some help, first, I'm not a coder so please consider that when replying.

I need to run a command that will do a ldap sync against A.D. and the VENDOR states that it can't be run as a whole and it must be split up in groups of lastnames like A-G, then H-......
So, the base command is "Ldap_sync". This command alone would grab A-Z. IF the vendor had scripted the executable correctly and it didn't run out of MEMORY. ( vendor is COMPUTER Associates. BOO.....)

So i need to run this command ( which works fine when typed on a cmd prompt, but NOT when run from a .Bat file. ( It does not like the % that is embeeded within the command.)

ldap_sync -c "last_name LIKE 'A%' AND type != 2308” -l “userid=?”

Thank you all for reading this and verified SOLUTION.!You need to 'escape' the % char as it is special to DOS, your line should look like this -

ldap_sync -c "last_name LIKE 'A^%' AND type != 2308” -l “userid=?”

the ^ before the % MEANS treat it literally as a % and not the special meaning it normally has.
GrahamTHx for the reply, but please.......( as I would and do on Network System Mgmt sites).. VERIFY your posts\Replies..... Your solution is not valid and does not work as stated.Quote from: n505mw on October 25, 2007, 01:31:28 PM

THx for the reply, but please.......( as I would and do on Network System Mgmt sites).. VERIFY your posts\Replies..... Your solution is not valid and does not work as stated.

n505mw, maybe some good manners would help you here? Shouting in capitals and loudly whining will not get you the quality help you want.

We don't care what you would do on "Network System Mgmt sites".

Your forum style is not valid and does not work as needed.

Describe failure mode of supplied batch code.
I'm still wondering why the answer was not available on your "Network System Mgmt. Sites"...

you could try this
ldap_sync -c "last_name LIKE 'A%%' AND type != 2308” -l “userid=?”


Discussion

No Comment Found