How to pass a url to a batch script

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
linuxteche
Posts: 10
Joined: 26 Nov 2017 03:17

How to pass a url to a batch script

#1 Post by linuxteche » 26 Mar 2018 03:25

Hi, I want to pass a url to a batch script for example:

echo TaskID : %TasklId%

If the task id contains a value of 24 I want to pass that task id value to the below url

http://<server>/tasks?action=get&json=false&crit=id=24

Thanks,
Dinesh

penpen
Expert
Posts: 2009
Joined: 23 Jun 2013 06:15
Location: Germany

Re: How to pass a url to a batch script

#2 Post by penpen » 26 Mar 2018 07:57

Your discription of your issue is very short, so i'm unsure what you want to do.
Could it be that you are you looking for something like that:

Code: Select all

@echo off
setlocal enableExtensions enableDelayedExpansion
set "TasklId=24"
echo TaskID : %TasklId%
set "url=http://<server>/tasks?action=get&json=false&crit=id=%TasklId%"
set url
goto :eof
penpen

Post Reply