0

I have a rather peculiar issue. When I run a batch script to open a URL, all of the commands I have tried removes the characters %3 from my URL when sending the URL to the browser. Because of this, the URL does not open properly. Does anyone have any ideas?

I've tried start, rundll32, url.dll, FileProtocolHandler, etc., etc., etc., and none of them work. I even tried putting the link in quotations which did not work.

Original link example: https://service-now.com/sc_req_item_list.do?sysparm_query=active%3Dtrue^assignment_group%3Dddd73dd34070240048b6bd9617591f4e^ORassignment_group%3Df5c1bd534070240048b6bd9617591fbe^GOTOrequest.requested_for.location.nameLIKEUS%20%28^request.requested_for.location.nameNOT%20LIKEHouston^assigned_toISEMPTY^u_product_name!%3DNetwork%20and%20Email%20account%20-%20modified^u_product_name!%3DNetwork%20and%20Email%20account^u_product_name!%3DRe-enable%20user%20account^u_product_name!%3DAccount%20termination^u_product_name!%3DLync%20Instant%20Messaging&sysparm_first_row=1&sysparm_view="

Link Opened after running it from a batch file: https://service-now.com/sc_req_item_list.do?sysparm_query=activeDtrue^assignment_groupDddd73dd34070240048b6bd9617591f4e^ORassignment_groupDf5c1bd534070240048b6bd9617591fbe^GOTOrequest.requested_for.location.nameLIKEUS08^request.requested_for.location.nameNOT0LIKEHouston^assigned_toISEMPTY^u_product_name!DNetwork0and0Email0account0-0modified^u_product_name!DNetwork0and0Email0account^u_product_name!DRe-enable0user0account^u_product_name!DAccount0termination^u_product_name!DLync0Instant0Messaging&sysparm_first_row=1&sysparm_view=

Using the open commands in the command prompt window does work, however, just not from a batch file?

  • Your original link example is broken as it does not work when pasted into the firefox address bar. – DavidPostill Jul 28 '16 at 22:10
  • Hi @DavidPostill, thank you for trying to help me. I removed some things from the URL due to being for a company page and not meant for public access. Either way if you try out a batch script like with the following: rundll32 url.dll,FileProtocolHandler "[original link here]" Then you will see how the string of %3 gets removed at the hand over of the URL. Thanks! EDIT: Ok wow... I just noticed that the browser won't show the URL due to my modifications. Let me see please. – R0tten Jul 28 '16 at 22:31
  • Without having a real URL to test I will just make a comment. Your URL includes a lot of characters that have other meanings in a batch file, including %, ^, &, and !. You may need to escape some or all of these. – DavidPostill Jul 28 '16 at 22:35
  • Thanks for helping me. I did figure out how to get the browser to show the url, but feel a response to your statement would be more helpful for me. I totally agree with you but I thought by adding quotations that it would open the url exactly as typed? – R0tten Jul 28 '16 at 22:42
  • If you add quotes it is no longer a URL ... for example start www.google.com works, but start "www.google.com" fails as the first parameter to start that is quoted is assumed to be the title of a cmd window. – DavidPostill Jul 28 '16 at 22:43
0

If all else fails you may want to try using a url shortener to get a simpler url to use... assuming it's a static address or you can automate your own shortening process.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.