gingerpantman Posted June 8, 2015 Share Posted June 8, 2015 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\DefaultShortcutsandC:\Users\Public\Desktop Any help would be greatly appreciated! Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 8, 2015 Moderators Share Posted June 8, 2015 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 Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
argumentum Posted June 8, 2015 Share Posted June 8, 2015 well, you may need to add #RequireAdmin , also the ("@ProgramFilesDir\LANDesk... should be like (@ProgramFilesDir & "\LANDesk...Do those changes and try again. Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. Link to comment Share on other sites More sharing options...
ViciousXUSMC Posted June 8, 2015 Share Posted June 8, 2015 (edited) Your going to want to use this for your destination:@DesktopCommonDirElse 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 June 8, 2015 by ViciousXUSMC Link to comment Share on other sites More sharing options...
gingerpantman Posted June 9, 2015 Author Share Posted June 9, 2015 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? Link to comment Share on other sites More sharing options...
gingerpantman Posted June 9, 2015 Author Share Posted June 9, 2015 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) 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