Replace a file in a folder tree with an updated version?
Moderators: white, Hacker, petermad, Stefan2
Re: Replace a file in a folder tree with an updated version?
Yes, it still says:
Line: 58
Char: 4
Error: Permission denied
Image: https://i.postimg.cc/vTCP195f/image.png
But the files were updated.
Line: 58
Char: 4
Error: Permission denied
Image: https://i.postimg.cc/vTCP195f/image.png
But the files were updated.
Re: Replace a file in a folder tree with an updated version?
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
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
Re: Replace a file in a folder tree with an updated version?
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:
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! π
Re: Replace a file in a folder tree with an updated version?
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...
Re: Replace a file in a folder tree with an updated version?
Run cmd from the admin and run: TAKEOWN /F S:\Test /R /D Y
Then check again.
Then check again.
Overquoting is evil! π
Re: Replace a file in a folder tree with an updated version?
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.
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.
Re: Replace a file in a folder tree with an updated version?
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? β
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! π
Re: Replace a file in a folder tree with an updated version?
I have UAC totally disabled.
If you mean in the TC's window titlebar, no.
No AlwaysAsAdmin=1 either in wincmd.ini
That opens a terminal window from the TC command line.
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.
Re: Replace a file in a folder tree with an updated version?
Understood.
Task Manager processes don't have wscript.exe?
Overquoting is evil! π
Re: Replace a file in a folder tree with an updated version?
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):
Is that so?
Have you tried creating the Test folder again?
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
Have you tried creating the Test folder again?
Overquoting is evil! π
Re: Replace a file in a folder tree with an updated version?
Ah, now it works... a window shows up that says "The check was succesful".
Re: Replace a file in a folder tree with an updated version?
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.
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! π
Re: Replace a file in a folder tree with an updated version?
Seems ok for now then. Just wanted to thank you again for all your efforts Fla$her.
Re: Replace a file in a folder tree with an updated version?
Good. Did you notice that 6 days ago I slightly refreshed the code?
Overquoting is evil! π