Solved

Batch Program to Open Specific Workflow in SharePoint

Posted on 2014-04-29
2
340 Views
Last Modified: 2014-09-15
I have the following code almost working 100%

@echo off
set /p RequestID=Request ID: 
Set /a RequestID2=RequestID + 1

start /d "C:\Program Files\Internet Explorer" IEXPLORE.EXE breview.jnj.com/_layouts/Workflow.aspx?ID=%RequestID2%&List={639B9AC2-79D3-47B1-A273-B8ED0700C09F}&Source=http%3A%%2F%%2Fbreview%2Ejnj%2Ecom%%2FHCC%5FRequest%%2FForms%%2FAllItems%2Easpx%%3FRootFolder%%3D%%252fHCC%%255fRequest%252fREQUEST%255f%RequestID%

Open in new window


It opens up a new browser window with the URL.. however it has %22 after http:// which is causing the page to not display. If I removed the %22 it works fine.

http://%22breview.jnj.com/_layouts/Workflow.aspx?ID=1569&List={639B9AC2-79D3-47B1-A273-B8ED0700C09F}&Source=httpA%2F%2FbreviewEjnjEcom%2FHCCFRequest%2FForms%2FAllItemsEaspx%3FRootFolder%3D%252fHCC%255fRequest52fREQUEST55f1568

The issue is if I remove the leading " i the code the URL gets truncated after "Workflow.aspx?ID=1569" where the & is.

Is there some way to break this string up so it all display the needed full URL without the quote?

thanks

Adam
0
Comment
Question by:aehrenwo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 4

Accepted Solution

by:
pstrong earned 230 total points
ID: 40201711
did you try to put double quotes around the url, ie:

start /d "C:\Program Files\Internet Explorer" IEXPLORE.EXE "<your url>"

Open in new window


It worked on a windows 7 box for me.

If you need to escape % characters you should be able to use %%, or ^%.

Also, you shouldnt need to encode the query string, you should just be able to pass the actual parameter values without encoding, ie:

&Source=http://breview.jnj.com/Request/Forms/AllItems.aspx?RootFolder=Request&REQUEST=%RequestID%

Hope that helps.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
Simple Linear Regression

729 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question