Replace a file in a folder tree with an updated version?

English support forum

Moderators: white, Hacker, petermad, Stefan2

User avatar
jesped
Member
Member
Posts: 150
Joined: 2005-02-07, 03:28 UTC

Re: Replace a file in a folder tree with an updated version?

Post by *jesped »

Yes, it still says:

Line: 58
Char: 4
Error: Permission denied

Image: https://i.postimg.cc/vTCP195f/image.png

But the files were updated. :D
User avatar
jesped
Member
Member
Posts: 150
Joined: 2005-02-07, 03:28 UTC

Re: Replace a file in a folder tree with an updated version?

Post by *jesped »

Weird thing: I created a Subfolder "S:\Test" yesterday, where I reproduced the same folder structure of the games in root S:\:

s:\Test\Armored Core VI Fires of Rubicon\
s:\Test\Forza Horizon 5\
s:\Test\Steam\steamapps\common\assettocorsa\
s:\Test\Steam\steamapps\common\Horizon Zero Dawn\
s:\Test\Steam\steamapps\common\Resident Evil Village BIOHAZARD VILLAGE\

Now the files inside all the game subfolders in S:\ are updated, but those inside S:\Test subfolders are not:

Image: https://i.postimg.cc/GpbXsbT7/image.png
Fla$her
Power Member
Power Member
Posts: 2318
Joined: 2020-01-18, 04:03 UTC

Re: Replace a file in a folder tree with an updated version?

Post by *Fla$her »

Look at the access rights of the "Test" folder and its subfolders. Perhaps they are different from the others.
Try to run the script with elevated rights by specifying the following entry in the first field of the button:
*%$System%\wscript.exe "%COMMANDER_PATH%\Scripts\UpdateFilesInTargetTree.vbs"
Overquoting is evil! πŸ‘Ž
User avatar
jesped
Member
Member
Posts: 150
Joined: 2005-02-07, 03:28 UTC

Re: Replace a file in a folder tree with an updated version?

Post by *jesped »

Nah, doesn't work. Even removed all attributes from the "S:\Test" folder and all its subfolders and files in TC but still doesn't work...
Fla$her
Power Member
Power Member
Posts: 2318
Joined: 2020-01-18, 04:03 UTC

Re: Replace a file in a folder tree with an updated version?

Post by *Fla$her »

Run cmd from the admin and run: TAKEOWN /F S:\Test /R /D Y
Then check again.
Overquoting is evil! πŸ‘Ž
User avatar
jesped
Member
Member
Posts: 150
Joined: 2005-02-07, 03:28 UTC

Re: Replace a file in a folder tree with an updated version?

Post by *jesped »

It happened all the same. My user was already an Administrator and created the folder.

If I enter the folder, then there is no error AND the files are updated... so the problem is for some reason related to the drive's root folder.
Fla$her
Power Member
Power Member
Posts: 2318
Joined: 2020-01-18, 04:03 UTC

Re: Replace a file in a folder tree with an updated version?

Post by *Fla$her »

If you have UAC enabled, then the profile doesn't matter. I'm writing about an elevation run.
Is there a '^' sign in the TC header? Is AlwaysAsAdmin=1 in the [Configuration] section ?
If yes, did cmd (cm_ExecuteDOS) start from the TC command line?

Let's localize the problem. What will appear if such a code is executed by Enter? β€”
Test.vbs

Code: Select all

Option Explicit: D = "S:\"  ' drive selection
Dim oFSO, TPath, Once, c, D
Set oFSO = CreateObject("Scripting.FileSystemObject")
If Len(D) > 3 Then TPath = "\\.\" & D: Once = 1 Else TPath = D
Recursion oFSO.GetFolder(TPath)
If IsEmpty(c) Then MsgBox "The check was successful!", 262208

Sub Recursion(oDir)
   If IsEmpty(Once) Then If Len(oDir.Path) > 3 Then _
   Set oDir = oFSO.GetFolder("\\.\" & oDir.Path): Once = 1
   On Error Resume Next
   For Each D in oDir.SubFolders: Recursion D: Next
   If Err.Number <> 0 Then c = 1:_
   MsgBox oDir.Path & vbLf & Err.Description, 262192: WSH.Quit
   On Error GoTo 0
End Sub
Overquoting is evil! πŸ‘Ž
User avatar
jesped
Member
Member
Posts: 150
Joined: 2005-02-07, 03:28 UTC

Re: Replace a file in a folder tree with an updated version?

Post by *jesped »

Fla$her wrote: ↑2023-11-28, 04:35 UTC If you have UAC enabled, then the profile doesn't matter. I'm writing about an elevation run.
I have UAC totally disabled.
Fla$her wrote: ↑2023-11-28, 04:35 UTCIs there a '^' sign in the TC header? Is AlwaysAsAdmin=1 in the [Configuration] section ?
If you mean in the TC's window titlebar, no.
No AlwaysAsAdmin=1 either in wincmd.ini
Fla$her wrote: ↑2023-11-28, 04:35 UTCIf yes, did cmd (cm_ExecuteDOS) start from the TC command line?
That opens a terminal window from the TC command line.
Fla$her wrote: ↑2023-11-28, 04:35 UTCLet's localize the problem. What will appear if such a code is executed by Enter? β€”
As far as I can see nothing happens when I run that .vbs, either from a terminal window, from TC's command line or from a toolbar button. I don't see any window opening or any message.
Fla$her
Power Member
Power Member
Posts: 2318
Joined: 2020-01-18, 04:03 UTC

Re: Replace a file in a folder tree with an updated version?

Post by *Fla$her »

jesped wrote: ↑2023-11-28, 05:05 UTCI have UAC totally disabled.
Understood.
jesped wrote: ↑2023-11-28, 05:05 UTCI don't see any window opening or any message.
Task Manager processes don't have wscript.exe?
Overquoting is evil! πŸ‘Ž
User avatar
jesped
Member
Member
Posts: 150
Joined: 2005-02-07, 03:28 UTC

Re: Replace a file in a folder tree with an updated version?

Post by *jesped »

Fla$her wrote: ↑2023-11-28, 05:30 UTC Task Manager processes don't have wscript.exe?
It shows up in task manager for like 2-3 seconds and then disappears.
Fla$her
Power Member
Power Member
Posts: 2318
Joined: 2020-01-18, 04:03 UTC

Re: Replace a file in a folder tree with an updated version?

Post by *Fla$her »

The fact that the message did not appear is very strange. According to the previous error, it should appear when the following code is executed (which is essentially the same thing):
Spoiler

Code: Select all

Option Explicit: D = "S:\"  ' drive selection
Dim oFSO, TPath, Once, c, D
Set oFSO = CreateObject("Scripting.FileSystemObject")
If Len(D) > 3 Then TPath = "\\.\" & D: Once = 1 Else TPath = D
On Error Resume Next
Recursion oFSO.GetFolder(TPath)
If IsEmpty(c) Then MsgBox "The check was successful!", 262208

Sub Recursion(oDir)
   If IsEmpty(Once) Then If Len(oDir.Path) > 3 Then _
   Set oDir = oFSO.GetFolder("\\.\" & oDir.Path): Once = 1
   For Each D in oDir.SubFolders: Recursion D: Next
   If Err.Number <> 0 Then c = 1:_
   MsgBox oDir.Path & vbLf & Err.Description, 262192: WSH.Quit
End Sub
Is that so?

Have you tried creating the Test folder again?
Overquoting is evil! πŸ‘Ž
User avatar
jesped
Member
Member
Posts: 150
Joined: 2005-02-07, 03:28 UTC

Re: Replace a file in a folder tree with an updated version?

Post by *jesped »

Ah, now it works... a window shows up that says "The check was succesful".
Fla$her
Power Member
Power Member
Posts: 2318
Joined: 2020-01-18, 04:03 UTC

Re: Replace a file in a folder tree with an updated version?

Post by *Fla$her »

Without recreating the folder? If yes, then it's unclear where the access error could have come from. There is no logic in this.

I would also try to restart TC and run the source script without opening the Test folder. Sometimes TC or some plugin can lock a folder.
Overquoting is evil! πŸ‘Ž
User avatar
jesped
Member
Member
Posts: 150
Joined: 2005-02-07, 03:28 UTC

Re: Replace a file in a folder tree with an updated version?

Post by *jesped »

Seems ok for now then. Just wanted to thank you again for all your efforts Fla$her.
Fla$her
Power Member
Power Member
Posts: 2318
Joined: 2020-01-18, 04:03 UTC

Re: Replace a file in a folder tree with an updated version?

Post by *Fla$her »

Good. Did you notice that 6 days ago I slightly refreshed the code?
Overquoting is evil! πŸ‘Ž
Post Reply