Permission denied on CopyFile in VBS

后端 未结 7 1288
無奈伤痛
無奈伤痛 2020-11-30 11:08

I\'m trying to automate pushing a file into my users\' home directories, but am stuck on a \"Permission Denied\" error — is thrown on line 6 here, with the CopyFile call.

7条回答
  •  春和景丽
    2020-11-30 11:35

    Based upon your source variable (sourcePath = "C:\Minecraft\bin\") I suspect your hard code is pointing at the wrong place

    fso.CopyFile "C:\Minecraft\options.txt", destinationPath, false
    

    should be

    fso.CopyFile "C:\Minecraft\bin\options.txt", destinationPath
    

    or

    fso.CopyFile sourcePath & "options.txt", destinationPath
    

提交回复
热议问题