Page 1 of 1

Solved: Help copying a Python file

Published: February 15, 2016 - 3:05 PM
by tienou
Good morning,

I'm a beginner in Python.
I have a very simple VBS script but I can't translate it.
If someone could help me, I would make progress in understanding this language.

THANKS

Code: Select all

If Not Fso.FolderExists("C:\Users\Default\Documents\FirstClass\") Then
Fso.CreateFolder("C:\Users\Default\Documents\FirstClass\")
End IF
If Not Fso.FolderExists("C:\Users\Default\Documents\FirstClass\settings\") Then
Fso.CreateFolder("C:\Users\Default\Documents\FirstClass\settings\")
End IF
Fso.CopyFile "\\10.42.20.221\waptdev\wapt-firstclassclient-wapt.12.110-0\home.fc","C:\Users\Default\Documents\FirstClass\settings\",True

Re: Help copying Python file

Published: February 15, 2016 - 3:21 PM
by htouvet
Literal answer:

Code: Select all

def install():
    mkdirs(r'C:\Users\Default\Documents\FirstClass\settings')
    filecopyto(r'\\10.42.20.221\waptdev\wapt-firstclassclient-wapt.12.110-0\home.fc',r'C:\Users\Default\Documents\FirstClass\settings')
(Perhaps it would be cleaner to include \\wapt-firstclassclient-wapt.12.110-0\home.fc in the package...)

Re: Help copying Python file

Published: February 15, 2016 - 4:16 PM
by tienou
Thanks htouvet :D
, even though it doesn't work.
I think there's a permissions issue :( .

Re: Help copying Python file

Published: February 15, 2016 - 4:19 PM
by htouvet
The share \\10.42.20.221\waptdev is definitely not accessible to the System account under which the wapt service runs on the machine.

That's why it's better to put the "home.fc" file directly in the package...

Re: Help copying Python file

Published: February 18, 2016 - 09:47
by tienou
htouvet wrote:The share \\10.42.20.221\waptdev is definitely not accessible to the System account under which the wapt service runs on the machine.

That's why it's better to put the "home.fc" file directly in the package...
It works by putting the file in the package, thank you :)