Homeseer666 Posted March 28, 2021 Posted March 28, 2021 The following works if manually entered from an admin (required) command prompt: C:\windows\system32\curl.exe -s -k -H "Authorization: Bearer xxxxxAPI keyxxxxx" "http://192.168.0.117:3000/render/xxxxx" > c:\temp\test34.png But not this : #RequireAdmin ShellExecute('C:\windows\system32\curl.exe','-s -k -H "Authorization: Bearer xxxxxAPI keyxxxxx" "http://192.168.0.117:3000/render/xxxxx" > c:\temp\test34.png') Or this: #RequireAdmin Run('C:\windows\system32\curl.exe -s -k -H "Authorization: Bearer xxxxxAPI keyxxxxx" "http://192.168.0.117:3000/render/xxxxx" > c:\temp\test34.png') The program seems to run but doesn't return result (png file creation), like when admin rights are missing. Probably something obvious missing, Can someone assist with troubleshooting ? Thank you!
Nine Posted March 28, 2021 Posted March 28, 2021 (edited) You need to start the shell to be able to redirect data to a file : Run(@comspec & ' /c C:\windows\system32\curl.exe -s -k -H "Authorization: Bearer xxxxxAPI keyxxxxx" "http://192.168.0.117:3000/render/xxxxx" > c:\temp\test34.png') Edited March 28, 2021 by Nine “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
Homeseer666 Posted March 28, 2021 Author Posted March 28, 2021 Merci/Thanks for the prompt response, works perfectly. Is there a good write up on @comspec usage as I'd like to better understand how "/c" "/k" and other parameters/arguments are used. Cheers,
TheXman Posted March 28, 2021 Posted March 28, 2021 (edited) Alternatively, you could write the curl output to a file using the -o switch. #RequireAdmin ShellExecute('C:\windows\system32\curl.exe','-sk -H "Authorization: Bearer xxxxxAPI keyxxxxx" -o c:\temp\test34.png "http://192.168.0.117:3000/render/xxxxx"') or Run('C:\windows\system32\curl.exe -sk -H "Authorization: Bearer xxxxxAPI keyxxxxx" -o c:\temp\test34.png "http://192.168.0.117:3000/render/xxxxx"') Edited March 28, 2021 by TheXman CryptoNG UDF: Cryptography API: Next Gen jq UDF: Powerful and Flexible JSON Processor | jqPlayground: An Interactive JSON Processor Xml2Json UDF: Transform XML to JSON | HttpApi UDF: HTTP Server API | Roku Remote: Example Script About Me How To Ask Good Questions On Technical And Scientific Forums (Detailed) | How to Ask Good Technical Questions (Brief) "Any fool can know. The point is to understand." -Albert Einstein "If you think you're a big fish, it's probably because you only swim in small ponds." ~TheXman
Musashi Posted March 28, 2021 Posted March 28, 2021 12 minutes ago, Homeseer666 said: Is there a good write up on @comspec usage as I'd like to better understand how "/c" "/k" and other parameters/arguments are used. Start with e.g. https://ss64.com/nt/cmd.html TheXman 1 "In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move."
Nine Posted March 28, 2021 Posted March 28, 2021 @Musashi has provided you my preferred link. I refer to it from time to time. DOS gets further and further far away in my memory Musashi 1 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
Homeseer666 Posted March 28, 2021 Author Posted March 28, 2021 Thanks @Musashi and @Nine for the link, much appreciated, @TheXman the -o switch works equally well; thanks for sharing. Is "-sk" a typo or are switch combinations allowed ?
TheXman Posted March 28, 2021 Posted March 28, 2021 (edited) 24 minutes ago, Homeseer666 said: are switch combinations allowed ? Curl's single-dash options, that do not require additional information, can be combined. https://curl.se/docs/manpage.html Look under OPTIONS Edited March 28, 2021 by TheXman CryptoNG UDF: Cryptography API: Next Gen jq UDF: Powerful and Flexible JSON Processor | jqPlayground: An Interactive JSON Processor Xml2Json UDF: Transform XML to JSON | HttpApi UDF: HTTP Server API | Roku Remote: Example Script About Me How To Ask Good Questions On Technical And Scientific Forums (Detailed) | How to Ask Good Technical Questions (Brief) "Any fool can know. The point is to understand." -Albert Einstein "If you think you're a big fish, it's probably because you only swim in small ponds." ~TheXman
Musashi Posted March 28, 2021 Posted March 28, 2021 1 minute ago, Nine said: @Musashi has provided you my preferred link. ... Mine as well . @Homeseer666 : On https://ss64.com/nt/ you will find almost everything you need. There are also a number of commands that can be executed using Run and RunWait directly (without @Comspec). "In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move."
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now