BasicNTService.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:SameKeyProxy 作者: xzhou 项目源码 文件源码
def CustomOptionHandler(cls, opts):
        #out=open("c:\\log.txt","w")
        print "Installing the Pyro %s" % cls._svc_name_
        args = raw_input("Enter command line arguments for %s: " % cls._svc_name_)
        try:
            createRegistryParameters(cls._svc_name_, args.strip())
        except Exception,x:
            print "Error occured when setting command line args in the registry: ",x
        try:
            cls._svc_description_
        except LookupError:
            return

        key = win32api.RegCreateKey(win32con.HKEY_LOCAL_MACHINE,
            "System\\CurrentControlSet\\Services\\%s" % cls._svc_name_)
        try:
            win32api.RegSetValueEx(key, "Description", 0, win32con.REG_SZ, cls._svc_description_);
        finally:
            win32api.RegCloseKey(key)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号