Guest Peter Posted June 22, 2004 Share Posted June 22, 2004 Hi, i've got a small Problem. I had to move a .lnk File from a various User Account to the All User Startmenu Tree. This is my Function. It doesn't work. How to get it work? If FileExists ("C:\Dokumente und Einstellungen\" & @UserName "\Startmenü\Programme\Microsoft Word Viewer.lnk") Then FileMove ("C:\Dokumente und Einstellungen\" & @UserName "\Startmenü\Programme\Microsoft Word Viewer.lnk" , "C:\Dokumente und Einstellungen\All Users\Startmenü\Programme\Microsoft Word Viewer.lnk") EndIf Thanks Peter Link to comment Share on other sites More sharing options...
Guest Doxie Posted June 22, 2004 Share Posted June 22, 2004 I made a test myself, and it worked perfectly. Almost the same code as you. This is my code If FileExists("C:\Documents and Settings\Doxie\Start Menu\Programs\test.lnk") Then FileMove("C:\Documents and Settings\Doxie\Start Menu\Programs\test.lnk", "C:\Documents and Settings\All Users\Start Menu\Programs\test.ini") EndIf Don´t know why its not working for you? Do you got admin rights when running the script? Link to comment Share on other sites More sharing options...
Developers Jos Posted June 22, 2004 Developers Share Posted June 22, 2004 Did you Cut&Paste your code ?There is a typo in this line:FileMove ("C:\Dokumente und Einstellungen\" & @UserName & "\Startmenü\Programme\Microsoft Word Viewer.lnk" , "C:\Dokumente und Einstellungen\All Users\Startmenü\Programme\Microsoft Word Viewer.lnk") SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Guest Doxie Posted June 22, 2004 Share Posted June 22, 2004 aah That´s why my code is working, cause i did not use @UserName Link to comment Share on other sites More sharing options...
emmanuel Posted June 22, 2004 Share Posted June 22, 2004 (edited) you missed an &:If FileExists ("C:\Dokumente und Einstellungen\" & @UserName &"\Startmenü\Programme\Microsoft Word Viewer.lnk") ThenFileMove ("C:\Dokumente und Einstellungen\" & @UserName & "\Startmenü\Programme\Microsoft Word Viewer.lnk" , "C:\Dokumente und Einstellungen\All Users\Startmenü\Programme\Microsoft Word Viewer.lnk")EndIfyou could also use @UserProfileDir.as they say in the business; the first one's free:If FileExists (@ProgramsDir & "\Microsoft Word Viewer.lnk") Then FileMove (@ProgramsDir & "\Microsoft Word Viewer.lnk" , @ProgramsCommonDir & "\Microsoft Word Viewer.lnk") EndIfCheck out Macro Referance - Directory. in the ... you guessed it... Helpfile.edited the code, fixed to @programsdir... Edited June 22, 2004 by emmanuel "I'm not even supposed to be here today!" -Dante (Hicks) 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