Elephant007 Posted August 27, 2011 Share Posted August 27, 2011 (edited) Where I work, we've locked down users from installing software, we push it to them. I have to figure a way to install AutoCAD on users computers and I am unable to with some software we purchased, I am able to create an AutoIt script to install the software What I do is push the AutoIt to the users computer and put a link on @DesktopCommonDir which points to a folder @ProgramFilesDir & "\Installs" The problem I am having is figuring out how to delete the shortcut after the program installs AutoItSetOption("TrayIconHide", 0 ) $SOURCE = "\\FILE4\AUTODESK-2011\AUTOCAD2011" RUNASWAIT1("elevateduser", "domain", "elevateduserpasswordhere", 1, $SOURCE & "\AdminImage\Setup.exe /qb /I " & $SOURCE & "\AdminImage\AutoCAD2011.ini /language en-us", "", @SW_HIDE) While 1 If Not ProcessExists ( "Setup.exe" ) Then MsgBox ( 64, "AutoCAD 2011 Install", "AutoCAD 2011 Install Complete..." ) RunAs ("elevateduser", "domain", "elevateduserpasswordhere", 1, "C:\Program Files\AISDInstallers\DeleteAutoCAD.exe", @SW_HIDE) Exit EndIf WEnd DeleteAutoCAD.exe AutoItSetOption ( "TrayIconHide", 1 ) Sleep ( 2000 ) FileDelete ( @DesktopCommonDir & "\AutoCAD2011Install.lnk" ) As I said, the program installs perfectly, I am just unable to figure out how to delete the link on @DesktopCommonDir The script does not delete the shortcut if I run DeleteAutoCAD.exe manually, it deletes the shortcut so I at least know the code is correct Thank you for your help Edited August 27, 2011 by Elephant007 Link to comment Share on other sites More sharing options...
Elephant007 Posted August 27, 2011 Author Share Posted August 27, 2011 (edited) Figured it out on my own I added ProcessClose ( "AutoCAD2011Install.exe" ) AutoItSetOption ( "TrayIconHide", 1 ) ProcessClose ( "AutoCAD2011Install.exe" ) Sleep ( 2000 ) FileDelete ( @DesktopCommonDir & "\AutoCAD2011Install.lnk" ) Simple! Edited August 27, 2011 by Elephant007 Link to comment Share on other sites More sharing options...
dannyict Posted August 28, 2011 Share Posted August 28, 2011 thanks for the solution Link to comment Share on other sites More sharing options...
Elephant007 Posted August 29, 2011 Author Share Posted August 29, 2011 you bet! Too often in forums, people figure out a solution on their own only to post "I figured it out" and not give a concise explanation of how they solved it, that frustrates me to no end!!! I don't want to be one of those people 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