Hello all. I am new to Comodo and new to the Python programming language, so try not to beat on me too much.
I have a Windows 7 computer with WinSCP installed. I am trying to FTP a zip file to my cloud server via a Comodo Procedure. I can carry it out successfully via the Windows CLI, but when I run it in Comodo, the zip file does not copy.
Anyone have insights on what Iâm doing wrong here?
cmd=âcd âC:\Program Files (x86)\WinSCPââ
cmd=âwinscp.com /command âoption batch abortâ âoption confirm offâ âopen ftp://username:password@hostname.com:21ââ
cmd=âcd incomingâ
cmd=âcd MBAM_Logsâ
cmd=âlcd C:\ProgramData\Malwarebytes\MBAMService\ScanResultsâ
cmd=âput *.zipâ
cmd=âexitâ
import os;
import ctypes
class disable_file_system_redirection:
_disable = ctypes.windll.kernel32.Wow64DisableWow64FsRedirection
_revert = ctypes.windll.kernel32.Wow64RevertWow64FsRedirection
def enter(self):
self.old_value = ctypes.c_long()
self.success = self._disable(ctypes.byref(self.old_value))
def exit(self, type, value, traceback):
if self.success:
self._revert(self.old_value)
with disable_file_system_redirection():
out=os.popen(cmd).read();
print(out);