コード例 #1
0
def DumpRemoteFolders():
    # Dump all special folders possible.
    for name, val in list(wincerapi.__dict__.items()):
        if name[:6] == "CSIDL_":
            try:
                loc = str(wincerapi.CeGetSpecialFolderPath(val))
                print("Folder %s is at %s" % (name, loc))
            except win32api.error as details:
                pass

    # Get the shortcut targets for the "Start Menu"
    print("Dumping start menu shortcuts...")
    try:
        startMenu = str(
            wincerapi.CeGetSpecialFolderPath(wincerapi.CSIDL_STARTMENU))
    except win32api.error as details:
        print("This device has no start menu!", details)
        startMenu = None

    if startMenu:
        for fileAttr in wincerapi.CeFindFiles(os.path.join(startMenu, "*")):
            fileName = fileAttr[8]
            fullPath = os.path.join(startMenu, str(fileName))
            try:
                resolved = wincerapi.CeSHGetShortcutTarget(fullPath)
            except win32api.error as xxx_todo_changeme:
                (rc, fn, msg) = xxx_todo_changeme.args
                resolved = "#Error - %s" % msg
            print("%s->%s" % (fileName, resolved))
コード例 #2
0
ファイル: pysynch.py プロジェクト: xiaoxi-s/MyEdaCalculator
def FindFiles(spec, local=1):
    if local:
        return win32api.FindFiles(spec)
    else:
        return wincerapi.CeFindFiles(spec)
コード例 #3
0
                loc = str(wincerapi.CeGetSpecialFolderPath(val))
                print "Folder %s is at %s" % (name, loc)
            except win32api.error, details:
                pass

    # Get the shortcut targets for the "Start Menu"
    print "Dumping start menu shortcuts..."
    try:
        startMenu = str(
            wincerapi.CeGetSpecialFolderPath(wincerapi.CSIDL_STARTMENU))
    except win32api.error, details:
        print "This device has no start menu!", details
        startMenu = None

    if startMenu:
        for fileAttr in wincerapi.CeFindFiles(os.path.join(startMenu, "*")):
            fileName = fileAttr[8]
            fullPath = os.path.join(startMenu, str(fileName))
            try:
                resolved = wincerapi.CeSHGetShortcutTarget(fullPath)
            except win32api.error, (rc, fn, msg):
                resolved = "#Error - %s" % msg
            print "%s->%s" % (fileName, resolved)

    #       print "The start menu is at",
    #       print wincerapi.CeSHGetShortcutTarget("\\Windows\\Start Menu\\Shortcut to Python.exe.lnk")


def usage():
    print "Options:"
    print "-a - Execute all demos"