Jump to content

Copy shortcut


 Share

Recommended Posts

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)

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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!
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...