简体   繁体   中英

How to make a Batch file, that puts another batch file to a destination folder

I want to make a Batch File that puts file.bat to C:/Users/%USERNAME%/Desktop . I had referred THIS TUTORIAL but this didn't help for my batch file. I would like anyone to tell me the code to make it happen... Thanks in Advance.

There are many ways of doing this, using either copy or xcopy for example, as said in comments:

copy "file.bat" "%USERPROFILE%\Desktop\" 

But you need to have a specific question

Try this code:

Type ">" without quotes, that means overwrite, but if this: >> it means add data to file

Note that you can add as many lines as you want, but keep in mind about these signs ">" and ">>"

@echo off
cls
pause
cls
echo (Your text here)>>C:\Users\%username%\Desktop.

I tried that once in my game and then it worked for me.

Hope this helps!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM