Sign in to follow this  
Followers 0
Diana (Cda)

[Resolved] @ScriptDir + eliminating spaces in a filepath?

3 posts in this topic

#1 ·  Posted (edited)

I have a really great app that does a great job but that has trouble with spaces in its own filepath and name. It won't launch unless I somehow use its 8.3 filepath as I do with the script I set up, as seen here:

;==============================================================================
$app2launch = "L:\VIDEO\VIDTOO~1\APPP-A~1\avifrate.exe"
;==============================================================================

ShellExecute($app2launch)
'course, the minute I move it to its permanent folder or change the name of the folder for whatever reason (i.e., after a wipe/reinstall when Windows assigns another drive letter) this won't work anymore. Is there a way to script with @ScriptDir to make it a relative path but eliminating the spaces in the filepath somehow, like the DOS 8.3 format does, by any chance? I haven't a clue on how to do that but perhaps someone here does.

Thanks! :)

p.s., before someone kindly advises using the Windows utility to change drive letters, gave up after the third consecutive time XP insisted on reverting back to the drive letters it wanted! <g> I afterwards just ended up creating a UDF that all scripts reference for navigating my computer and just update that once after a wipe/reinstall. Much more reliable system this way! Gotta love AutoIt; it makes up for so many Windows deficiencies! <g>

Edited by Diana (Cda)

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

$shortPath = FileGetShortName(@ScriptDir & "\avifrate.exe")

Assuming your AutoIt script is in the same folder as avifrate.exe

Edited by Khab

Share this post


Link to post
Share on other sites

$shortPath = FileGetShortName(@ScriptDir & "\avifrate.exe")

Assuming your AutoIt script is in the same folder as avifrate.exe

Can't say it enough: gotta love AutoIt!!!

Thanks, this works just great on all the trials I just did. My script now looks like this:

;
; AutoIt
;

;=======================================================================
$8point3_short_filepath = FileGetShortName(@ScriptDir & "\avifrate.exe")
;=======================================================================

ShellExecute($8point3_short_filepath)

Exit     ; finished
Thanks! :)

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0