Jump to content
Sign in to follow this  

Finish My Script, Can't Delete LNK **FIGURED IT OUT**

Recommended Posts


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 )

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)


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 :mellow:

Thank you for your help

Edited by Elephant007

Share this post

Link to post
Share on other sites

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 :mellow:

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
Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.