Jump to content
gingerpantman

File copy

Recommended Posts

gingerpantman

Hi guys,

New to scripting and AutoIT so i apologies as this is probably a very stupid and basic question.

 

Basically on my new build machines i want some Icons from 1 location to be placed on the public desktop. I have the script below which seems to run but doesnt actually do anything.

FileCopy("@ProgramFilesDir\LANDesk\LDClient\sdmcache\ldms\Packages\DefaultShortcuts\*.*","@DesktopDir\Public\Desktop\", 1)

 

actual paths are C:\Program Files\LANDesk\LDClient\sdmcache\ldms\Packages\DefaultShortcuts

and

C:\Users\Public\Desktop

 

Any help would be greatly appreciated!

Share this post


Link to post
Share on other sites
Melba23

gingerpantman,

Welcome to the AutoIt forums.

Try it this way:

FileCopy(@ProgramFilesDir & "\LANDesk\LDClient\sdmcache\ldms\Packages\DefaultShortcuts\*.*", @DesktopDir & "\Public\Desktop\", 1)

You need to keep the macros outside the quotes or they are treated as literal strings.

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
argumentum

well, you may need to add #RequireAdmin , also the ("@ProgramFilesDir\LANDesk... should be like (@ProgramFilesDir & "\LANDesk...
Do those changes and try again.

Share this post


Link to post
Share on other sites
ViciousXUSMC

Your going to want to use this for your destination:

@DesktopCommonDir

Else you would just be trying to place your files on the current users desktop in a folder.

 

Also you can always create your own shortcuts with FileCreateShortcut()

https://www.autoitscript.com/autoit3/docs/functions/FileCreateShortcut.htm

 

The advantage being your not relying on any other files/paths for the source, the biggest issue I see with source usually is not having a check to see if 32bit or 64bit as each has a different programfilesdir. 

Edited by ViciousXUSMC

Share this post


Link to post
Share on other sites
gingerpantman

Hi guys,

Thanks for your help my script now looks like:

FileCopy(@ProgramFilesDir & "\LANDesk\LDClient\sdmcache\ldms\Packages\DefaultShortcuts\*.*", @DesktopCommonDir & "\Public\Desktop\", 1)

 

It still fails though, Is there anyway of turning on logging so i can see why its failing?

Share this post


Link to post
Share on other sites
gingerpantman

Scrap that. Got it working, I was specifiying the path again instead of just using the  @DesktopCommonDir. Thanks for your help guys!

 

FileCopy(@ProgramFilesDir & "\LANDesk\LDClient\sdmcache\ldms\Packages\DefaultShortcuts\shortcuts\*.*", @DesktopCommonDir, 1)

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

×