|
|
|||||||
No UDF is available for this, and it would be great if it were included in the Built-in functions. Several old utilities (ProfGen for one) choke on long file names. |
||||||||
|
|
|||||||
If you surround the 'long' filename by double quoutes and use 'Start' the short filename will be translated correctly! Example: code:-ErikShell '%COMSPEC% /C Start ProfGen "C:\Long name for directory\Long filename.ini"' |
||||||||
|
|
|||||||
True, but if you remember the inst.kix script from bbChecker, it uses addprogramitem which requires a shortname for the icon. Will try to write a UDF for you guys. Anyone know how shortnames are determined by the OS? |
||||||||
|
|
|||||||
Sure...basically its first six letters of the folder (no spaces) a ~ then a number. So... C:\A Long Folder would be... C:\alongf~1 |
||||||||
|
|
|||||||
C:\A Long Folder would be C:\alongf~1 C:\A Long Folder is here would be: C:\alongf~2 C:\A Long Folder is here to stay would be: C:\alongf~3 However, here is a MS KB on the subject. Short (8.3) File Names May Change When Copied A DIR /X will show the short file names FindFile/FindNextFile Query or DIR Query Does Not Return the Correct Set of Files How to Disable Automatic Short File Name Generation NOTE: Existing files using the short name format will still be available to 32-bit programs, but all files created after this change is implemented will be unavailable to older 16-bit programs. |
||||||||
|
|
|||||||
Profgen? Have used it fine with LFNs.. If you are having trouble, have you tried surrounding your LFN with ""'s. In other words: This is a long filename to be: "This is a long filename" HTH, Kent |
||||||||
|
|
|||||||
Guys, I knew about the ~; spaces and other illegal 8.3 chars are to be removed too. Also all dots except the last should be removed. What puzzles me is the "MS logic" i.e. in short names for folders like "a b" and "q w". DOn't see it... Anyone does??? |
||||||||
|
|
|||||||
you mean like with dir /x: code:27.11.2002 11:18 <KANSIO> . [ 27. November 2002, 10:18: Message edited by: Lonkero ] |
||||||||
|
|
|||||||
that'd make it a tiny bit harder to code the udf for it [ 27. November 2002, 10:24: Message edited by: jpols ] |
||||||||
|
|
|||||||
(Crazy) Eddie, Have a look at http://www.kixtart.org/cgi-bin/ultimatebb.cgi?ubb=get_topic&f=12&t=000307. You may find it helpful. Lee |
||||||||
|
|
|||||||
Hehe, shipping around the logical cliffs of creation by using things already available ... Cool {My vote for that !} [ 27. November 2002, 11:29: Message edited by: jpols ] |
||||||||
|
|
|||||||
already avail? just added... and I can't use it as it's wsh... |
||||||||
|
|
|||||||
I have the same problem of not being able to use it because I actively disable the creation of DOS-compatible (short) filenames under NTFS in order to increase file I/O performance. |
||||||||
|
|
|||||||
Wow...thanks for the replies. Let's take them apart: 1) The WSH option is a decent one, but I was looking for a KIX-only solution. 2) The use of double "" does not properly work for profgen. My command is "{path}profgen.exe {path}newprof.exe -P {path}my.prf {switches} -T {path}TempDir" If any of the second or more pathes have spaces, the command chokes. Quotes in a variety of ways have been tried...doesn't work. Short name pathing does work. However, as described, you can't reliably figure out MS's method for determining a short name, just by knowing the long name. 3) Dir/x works okay, execept when trying to get the short name for a directory itself. It will return the contents of the directory. 4) If a short name is not available because it has been disabled - that's a problem. Basicly, we need KIX to query the file system/OS to return a short name (if available) for a long name provided. That's what WSH is doing in the provided example. Great conversation! Ed [ 27. November 2002, 15:30: Message edited by: Crazy Eddie ] |
||||||||
|
|
|||||||
Please post the PROFGEN line that doesn't work. So far, any time I've had space in a pathname I was able to use quotes to properly use the pathname. DOS-compatible filenames are a legacy issue and one should get rid of those as fast as possible. [ 27. November 2002, 15:44: Message edited by: sealeopard ] |
||||||||
|
|
|||||||
The code at this point looks like this: code:This fails.IF "%USERPROFILE%"="" If you attempt to do the exact same thing in a command prompt, same effect. If you replace all of the LFNs with SFNs, it works. This is a DOS/Profgen issue, not a KIX issue. NOTE: The reason I am using $UserProfDir for the PRF and the temp directory is to handle multiple logins on a Citrix/TS environment, to ensure the files are not overwritten by other users. (That's my attempt, anyway.) Ed ps: SSN-638 and SSN-751 were in my past |
||||||||
|
|
|||||||
could we continue this in scripts: http://www.kixtart.org/cgi-bin/ultimatebb.cgi?ubb=get_topic&f=2&t=004001 as this problem has not so much to do with the suggestion. |
||||||||
|
|
|||||||
Dear, On this forum we had made also a request about shortcut names (KIX-FUNCTION: con- version of long/short filenames to short/long filenames). At this moment Ruud doesn't implement something like that. It looks like that a lot of new suggestions are copies of old ones. Possible that someone can reread this forum about all interesting suggestions, which aren't implementing at this moment. As list we can ask Ruud for his comment about it. In some situation he had return already comment on some of those oldies. greetings. (TO_DO) [ 07. December 2002, 11:25: Message edited by: MCA ] |
||||||||
|
|
|||||||
already really many of those is included in: http://www.kixtart.org/board/ultimatebb.php?ubb=get_topic;f=4;t=000282 |
||||||||
|
|
|||||||
Dear, We know, but it isn't in a very readable format for Ruud. greetings. |
||||||||
|
|
|||||||
Hmm.. lots of discussion on this. I would vote for a pure KiXtart solution that would return either the specific short file name of a given file, or the short file name of a given long file name provided none was present if a location was specified. For example, given a directory with a file: c:\howdyguys.txt -lfn c:\howdyg~1.txt -sfn (same file) sfn("howdyguys.txt") would return: howdyg~1.txt sfn("howdyguys1.txt") would also return: howdyg~1.txt sfn("howdyguys.txt","c:\") would return: howdyg~1.txt (because that's the short name of the existing file with that name) sfn("howdyguys1.txt","c:\") would return: howdyg~2.txt (because the file doesn't exist and there is already a howdyg~1.txt) ....... Just my 2 cents.. a UDF could be written for this as well, but I don't think it could be done purely in KiXtart (without using command prompt or WSH). Brian |
||||||||
|
|
|||||||
I can do this easily, but it will require WSHPipe or it will turn into a big slow script... Any interest?? basically redirecting a DIR /x $x |find $y into a variable to substr it. [ 02. January 2003, 22:41: Message edited by: Radimus ] |