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.psGenerate 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)