How do I make a script or automation that replaces a file in a certain folder with another file without manually doing so?

waiiatto 0 Reputation points
2024-07-26T04:02:00.2+00:00

I want to be able to quickly change a set of cursor png files in an application's file folder (Roblox) with custom ones that I have created. Right now every time this application receives an update, it resets the cursor files back to default, but I want to easily switch them back, without manually doing so, using some kind of install file or script I can execute. This isn't really an issue, but I just want to see how this is possible.

Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
8,987 questions
0 comments No comments
{count} votes

Accepted answer
  1. Michael Taylor 51,346 Reputation points
    2024-07-26T04:45:42.0666667+00:00

    Use Powershell. You don't really provide enough details for a full script. However let's assume that you want to replace a file called cursor.png that resides in a directory we'll call C:\target with the same named file stored in a directory called c:\source.

    $source = 'C:\source'
    $target = 'C:\target'
    cd $source
    copy cursor.png $target -force
    

    Of course if you wanted to copy all .png files then you can use wildcards.


0 additional answers

Sort by: Most helpful