Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Executing long Directory Command in DOS
Message
From
16/12/2013 09:34:20
 
 
To
15/12/2013 03:07:42
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01590257
Message ID:
01590370
Views:
67
>The command inside is
gswin32c.exe -sDEVICE="pdfwrite" -sPAPERSIZE=a4 -dNOPAUSE -dBATCH -dSAFER -dQUIET -sOUTPUTFILE=D:\COMP JAIPUR\20131106_20131101\100042\1001817119.Pdf D:\COMP JAIPUR\20131106_20131101\100042\1001817119.ps
Generate the output files to some temporary location, and then rename them afterward. Use this to get the short filename:
* Call with:
* lcShortFilename = getShortFilename(lcLongFilename, @llIsValid
* IF llIsValid
*     ? "Short filename: " + lcShortFilename
* ELSE
*     ? "Unable to determine short filename from: " + lcLongFilename
* ENDIF
FUNCTION getShortFilename
PARAMETERS pcLongFilename, plValid
LOCAL lcShortFilename, lnShortFilenameLength, lnReturnValue

    #DEFINE MAX_PATH 255
    DECLARE INTEGER GetShortPathName IN Kernel32 STRING @lpszLongPath, STRING @lpszShortPath, INTEGER cchBuffer
    DECLARE INTEGER GetLastError IN Win32api

    IF EMPTY(pcLongFilename)
        pcLongFilename = FULLPATH(CURDIR())
    ENDIF

    * buffer to receive converted file name
    lcShortFilename         = SPACE(MAX_PATH)
    lnShortFilenameLength   = LEN(lcShortFilename)

    * if successful, lnReturnValue will contain the length of the output string
    lnReturnValue = GetShortPathName(@pcLongFilename, @lcShortFilename, lnShortFilenameLength)
    IF lnReturnValue = 0
        plValid = .F.
        RETURN "?? Unable to get the short path"
    ENDIF
    plValid = .T.

    * truncate it at the length the return value indicates
    RETURN LEFT(lcShortFilename, lnReturnValue)
>My problem is that the input and output path being Long folder names as (perhaps more than 8 character)
>the process dont work.When I change the folder name to small one it works fine.
>
>But manually it is not possible to change name of thousnds of such folder.
>
>What is to be done. Any alternative ?
>
>Also one more related issue. The above conversion process is taking huge time , I am working on 32 Bit windows XP.
>Will my Migration to 64 Bit Win-7 and 8 will enhance my above speed of conversion.
>If yes, than how much time(if any Idea)
>
>Kinldy Guide
>Regards
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform