Jump to content

Delete Directory Using Wildcard


Recommended Posts

I am creating a multiple .exe installer, and want to delete a directory. The path is C:\Documents and Settings\svc\Desktop\OpenOffice.org 2.2 Installation Files My problem is that the user will vary. What do I need to do to have the "svc" as a wildcard? I'm new to autoit and this is my first script. Thanks in advance.

Link to comment
Share on other sites

Welcome to the forums!

There are macros that may help you. Use the @DesktopDir macro for the logged-in user's desktop...

@UserName may help too, but there's no guarantee that the User ID matches the profile name.

Also, if you're installing those files yourself, consider putting them in a temporary directory, like @TempDir.

[font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font]

Link to comment
Share on other sites

Welcome to the forums!

There are macros that may help you. Use the @DesktopDir macro for the logged-in user's desktop...

@UserName may help too, but there's no guarantee that the User ID matches the profile name.

Also, if you're installing those files yourself, consider putting them in a temporary directory, like @TempDir.

Thanks for the welcome. Dumb question how do I go about implementing the macro? I'm new to scripting/programing so I don't understand alot.

Link to comment
Share on other sites

Based on your example, if you're logged in as "svc", @DesktopDir should expand to "C:\Documents and Settings\svc\Desktop".

Add the path from there to what you need and the result is:

DirRemove(@DesktopDir & "\OpenOffice.org 2.2 Installation Files", 1)

[font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font]

Link to comment
Share on other sites

Great Thank you so much. So the macros go first.

No, they don't go first, they go where they have to go. The one that was used returns:

%homedrive%\Documents and Settings\%username%\Desktop

As a result, it must be placed before the rest of the string.

It doesn't matter where they go:

Msgbox(0,"",@HomeDrive & @HomePath & "\Desktop\OpenOffice.org 2.2 Installation Files")oÝ÷ Ù«­¢+Ù5ͽà À°ÅÕ½ÐìÅÕ½Ðì±!½µÉ¥ÙµÀìÅÕ½ÐìÀäÈí½Õµ¹Ñ̹MÑÑ¥¹ÌÀäÈìÅÕ½ÐìµÀìUÍɹµµÀìÅÕ½ÐìÀäÈíͭѽÀÀäÈí=Á¹=¥¹½ÉȸÈ%¹Íѱ±Ñ¥½¸¥±ÌÅÕ½ÐìoÝ÷ Ù«­¢+Ù5ͽà À°ÅÕ½Ðí
ÕÉɹÐQµÁ½ÉÉä¥ÉѽÉäèÅÕ½Ðì°ÅÕ½ÐíQ¡ÕÉɹÐѵÁ½ÉÉä¥ÉѽÉä¥ÌèÅÕ½ÐìµÀì
I1µÀ쥱Ñ1½¹9µ¡QµÁ¥È¤¤

It just has to be properly formatted into a string with ampersands (&).

- The Kandie Man ;-)

"So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...