batch file - How to set and get variables when working in cmd -


i working in cmd send http , post requests curl.

there many times sending requests same pages , typing them out every time huge pain.

i'm trying figure out how use set= can save these urls each time want use them.

i've tried

c:\>set page = "http://www.mywebpage.com/api/user/friends"  c:\>page 'page' not recognized internal or external command, operable program or batch file.  c:\>echo %page% %page% 

but won't return page name.

how can accomplish need?

c:\windows\system32>set page="http://www.mywebpage.com/api/user/friends"  c:\windows\system32>echo %page% "http://www.mywebpage.com/api/user/friends"  c:\windows\system32>set page=http://www.mywebpage.com/api/user/friends  c:\windows\system32>echo %page% http://www.mywebpage.com/api/user/friends 

don't use spaces around =. select version or without " according needs. variable value may contain spaces inside:

c:\windows\system32>set page=http://www.mywebpage.com/api/user/my friends  c:\windows\system32>echo %page% http://www.mywebpage.com/api/user/my friends 

Comments

Popular posts from this blog

php - Submit Form Data without Reloading page -

linux - Rails running on virtual machine in Windows -