Do not specify the path to a batch file

Asked

Viewed 55 times

0

To open a file on my computer, just put the path. C: Users Desktop example But if I were to, for example, create a batch for another computer, assuming there is a folder on the desktop called "example" and a file within it of text called "exemplo2", it probably wouldn’t work, since "User" would be another name (in the case of the person’s computer), there is some way around this?

1 answer

2

Try using %userprofile% instead of user

example:

%userprofile%\Desktop

It will directly access the user, regardless of which.

  • 1

    worked! thank you very much

Browser other questions tagged

You are not signed in. Login or sign up in order to post.