3

I want to make a batch so it can download files to a desktop folder for anyone who clicks on it

this is the static code

curl --output C:\Users\admin\Desktop\stuff/file.zip --url https://wordpress.org/latest.zip

I want to make it dynamic - the path changing depend on the pc

1
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
    – Community Bot
    Sep 18, 2021 at 10:49

1 Answer 1

4

I want to make it dynamic - the path changing depend on the pc

I presume by "dynamic" you want the path to refer to the user running the batch file?

In that case replace C:\Users\admin with the System environment variable %USERPROFILE%.

curl --output %USERPROFILE%\Desktop\stuff\file.zip --url https://wordpress.org/latest.zip

You need to make sure the directory Desktop\stuff exists otherwise create it.


Further Reading

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .