Sign in to follow this  
Followers 0
Stuttgart

Copy shortcut

6 posts in this topic

The file "Che" has no extension, is a shortcut, and is in the same dir as the script.

I would like a copy on the Desktop. I receive no error messages and the code continues after the statement. I even searched to see if the shortcut copy ended up somewhere else.... not the case.

FileCopy("Che","C:\Documents and Settings\All Users\Desktop",0)

Share this post


Link to post
Share on other sites



Shortcuts have the file extension ".lnk". Try "Che.lnk" as the file. (That's a lower-case L, not an uppercase i)

Share this post


Link to post
Share on other sites

Thank you! works great now! :whistle:

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

I wrote this little script to see what the actual dos filename was:

if $CmdLine[0]<>0 then
$name = FileGetShortName ( $CmdLine[1]) 
msgbox(1,"Short Name",$name ,40)
ClipPut ( $name  )
  else
      msgbox(1,"Short Name","Drag and Drop a file here to show small name",10)
  endif

It shows you the filename in the msgbox, and copies it to the clipboard with the full dos path as well.

Comes in handy.

edit... works great after you compile it. :whistle:

Edited by scriptkitty

AutoIt3, the MACGYVER Pocket Knife for computers.

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Certain extensions are always hidden by Windows because of the presence of a REG_SZ entry named NeverShowExt

If you want to always show LNK file extensions, then delte NeverShowExt from

HKEY_CLASSES_ROOT\lnkfile .

You can also use AlwaysShowExt registry value. Note that both registry settings overrride whether you have chosen to to "hide extensions for known file types" via Folder Options in the control panel.

P.S. Nice util, scriptkitty :whistle:

Here's a related program:

; Put compiled version in the Send To menu
;   and it copies long path(s) to clipboard

If $CmdLine[0] > 0 Then
  $tmp = ""
  For $i = 1 to $CmdLine[0]
    $tmp = $tmp & $CmdLine[$i] & @CRLF
  Next
  ClipPut( StringTrimRight($tmp,2) )
EndIf
Edited by CyberSlug

Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!

Share this post


Link to post
Share on other sites

thank you CyberSlug for that little script

i've tried it, works great!

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