- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-16-2017 06:02 AM
Hello,
I created a curl to extract all incident resolved last 15 minutes.
curl -v -u "username:password" "https://<myinstance>/api/now/table/incident?sysparm_query=resolved_atONLast%2015%20minutes%40javascript%3Ags.minutesAgoStart(15)%40javascript%3Ags.minutesAgoEnd(0)" \ --request GET \ --header "Accept:application/json" \ --insecure --noproxy '*' > F:\Incident_List.js
If I run this curl on cmd, the curl work fine.
If I run the curl in .bat file, the curl do not works (the code extract all incident).
My .bat file is the following:
@ ECHO OFF
curl -v -u "username:password" "https://<myinstance>/api/now/table/incident?sysparm_query=resolved_atONLast%2015%20minutes%40javascript%3Ags.minutesAgoStart(15)%40javascript%3Ags.minutesAgoEnd(0)" \ --request GET \ --header "Accept:application/json" \ --insecure --noproxy '*' > F:\Incident_List.js
exit
Why the .bat file do not works as my expect? Is there any special characters to avoid?
Regards
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-16-2017 06:36 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-16-2017 06:10 AM
Is that all on one line? If so, you shouldn't need those backslashes (\) before the -- arg delimiters. Try it without those and let me know.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-16-2017 06:36 AM
Hello,
I fixed inserting double '%' for every character '%'.
Regards

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-17-2017 05:48 AM
Thanks for sharing Ema. It's been a long time since I did batch files. Now that you say that, I remembered. Good job!