randallc Posted May 23, 2007 Share Posted May 23, 2007 (edited) Hi I have had some trouble with a script, and now find this func has not beeen working for a directory [or filename?] past the first level? - goes back some versions, before Unicode change; maybe forever? Run from helpfile; modified for an existing directory, thus; ;~ $a = FileGetShortName(@HomeDrive & "\Program Files") $a = FileGetShortName("C:\Program Files\AutoIt3\Copy of Examples\") ConsoleWrite("short file name="& $a&@LF) msgbox(0,"short file name", $a) ;$a is probably "x:\PROGRA~1" ; But output is ; short file name=C:\PROGRA~1\AutoIt3\Copy of Examples\Should be; C:\PROGRA~1\AutoIt3\Copy~1\ -or similar? Randall Edited May 23, 2007 by randallc ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW Link to comment Share on other sites More sharing options...
Rick Posted May 23, 2007 Share Posted May 23, 2007 (edited) if it doesnt exist it cant shorten it, if it does, then it does Edited May 23, 2007 by Rick Who needs puzzles when we have AutoIt!! Link to comment Share on other sites More sharing options...
randallc Posted May 24, 2007 Author Share Posted May 24, 2007 (edited) if it doesnt exist it cant shorten it, if it does, then it doesNot for me! That's my point; see example in post 1; that directory does indeed exist on my computer. Thanks, Randall []EDIT -PS it works OK an a different computer! -all XPSP2, although not the last few updates , last few weeks off broadband..] Edited May 24, 2007 by randallc ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW Link to comment Share on other sites More sharing options...
Administrators Jon Posted May 24, 2007 Administrators Share Posted May 24, 2007 If you open a cmd prompt and go into C:\Program Files\AutoIt3 Then do Dir /X Does it show a short file name entry for Copy of Examples? Deployment Blog:Â https://www.autoitconsulting.com/site/blog/ SCCM SDK Programming:Â https://www.autoitconsulting.com/site/sccm-sdk/ Link to comment Share on other sites More sharing options...
Valuater Posted May 24, 2007 Share Posted May 24, 2007 (edited) No problem here...$a = FileGetShortName("C:\Program Files\AutoIt3\Examples\EzSkin\EzSkin_1-2-3-0-2.exe") $b = FileGetShortName(@HomeDrive & "\Program Files\AutoIt3\Examples\EzSkin\EzSkin_1-2-3-0-2.exe") If FileExists($a) Then ConsoleWrite("short file name=" & $a & @LF) MsgBox(0, @AutoItVersion & " short file name", $a & @CRLF & $B) ;$a is probably "x:\PROGRA~1" Else MsgBox(0, "error", "short file name does not exist" & @CRLF & $a) EndIffolder or file...Win Xp SP2Autoit 3.2.2.0Beta 3.2.3.108) Edited May 24, 2007 by Valuater Link to comment Share on other sites More sharing options...
randallc Posted May 24, 2007 Author Share Posted May 24, 2007 (edited) If you open a cmd prompt and go into C:\Program Files\AutoIt3 Then do Dir /X Does it show a short file name entry for Copy of Examples?I'll look ; not at that computer again till later; it does return @error=1, btw! [could there be a setting in XP or disc error on that computer stopping it working?] Randall Edited May 24, 2007 by randallc ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW Link to comment Share on other sites More sharing options...
GaryFrost Posted May 24, 2007 Share Posted May 24, 2007 seems to work for me, example: $a = FileGetShortName("C:\Program Files\AutoIt3\AutoIt Debugger\") ConsoleWrite("short file name="& $a&@LF) msgbox(0,"short file name", $a) >"C:\Program Files\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "F:\Autoit_files\test2.au3" /autoit3dir "C:\Program Files\AutoIt3" /UserParams +>20:27:06 Starting AutoIt3Wrapper v.1.8.4 >Running AU3Check (1.54.7.0) from:C:\Program Files\AutoIt3 +>20:27:06 AU3Check ended.rc:0 >Running:(3.2.4.6):C:\Program Files\AutoIt3\autoit3.exe "F:\Autoit_files\test2.au3" short file name=C:\PROGRA~1\AutoIt3\AUTOIT~1\ +>20:27:09 AutoIT3.exe ended.rc:0 +>20:27:11 AutoIt3Wrapper Finished >Exit code: 0 Time: 5.047 SciTE for AutoItDirections for Submitting Standard UDFs  Don't argue with an idiot; people watching may not be able to tell the difference.  Link to comment Share on other sites More sharing options...
randallc Posted May 24, 2007 Author Share Posted May 24, 2007 Hi, Yes OK on another computer; seems to be reproducible just on 1 computer!; **could this move to help and support forum? Thanks, randall ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW Link to comment Share on other sites More sharing options...
randallc Posted May 24, 2007 Author Share Posted May 24, 2007 If you open a cmd prompt and go into C:\Program Files\AutoIt3Then do Dir /XDoes it show a short file name entry for Copy of Examples?No it doesn't for any within that directory!How annoying is that! - Do I need a computer tech or a new computer?Randall ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted May 24, 2007 Share Posted May 24, 2007 (edited) No it doesn't for any within that directory!How annoying is that! - Do I need a computer tech or a new computer?RandallI dont know how Autoit check filenames but if it takes them directly from the filesystem then are you sure you have creation of short filenames on??In newer operating systems(for example win XP) you can turn it off by editing a registrykey and since this is a unneccessary burden on your comp many people turn it off. But as I said, I dont know how Autoit gets filenames.Edit=Oh forgot to say that this is only on NTFS. Edited May 24, 2007 by TzarAlkex .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now