Jump to content
Sign in to follow this  
possy_99

newbie macro help

Recommended Posts

possy_99

hi all, just reg'd although I have been learning myself auto-it for a little while now, but I've came across this problem I'm hopeing someone can help me with.

I'm using auto it to automatically install certain programs, and I've got quite far thanks to the help files and example scripts. The problem comes when trying to move or delete unwanted desktop icons, some are in all users\desktop and some go in user profiles.

I've been using this in my scripts:

FileMove("C:\Documents and Settings\All Users\Desktop\shortcut.lnk", "C:\Documents and Settings\User\Application Data\Microsoft\Internet Explorer\QUICK LAUNCH\",1)

this worked fine when the shortcut is in all users\desktop but when the shortcut is in the user profiles desktop I have been using batch files and dos variables to locate the current logged on user ect.

I have discovered the macros in auto-it, but have never used them before. Here's what I have at the moment:

FileMove("@DesktopCommonDir\shortcut.lnk", "@AppDataCommonDir\Microsoft\Internet Explorer\QUICK LAUNCH\")

Now by looking at the help file I assume @DesktopCommonDir should give me the c:\documents and settings\all users\desktop path and the @AppDataCommonDir should give me C:\Documents and Settings\All Users\Application Data

needless to say, it don't work. can anyone help me?

Thanks!

Edited by possy_99

Share this post


Link to post
Share on other sites
AutoITPimp

hi all, just reg'd although I have been learning myself auto-it for a little while now, but I've came across this problem I'm hopeing someone can help me with.

I'm using auto it to automatically install certain programs, and I've got quite far thanks to the help files and example scripts. The problem comes when trying to move or delete unwanted desktop icons, some are in all users\desktop and some go in user profiles.

I've been using this in my scripts:

FileMove("C:\Documents and Settings\All Users\Desktop\shortcut.lnk", "C:\Documents and Settings\User\Application Data\Microsoft\Internet Explorer\QUICK LAUNCH\",1)

this worked fine when the shortcut is in all users\desktop but when the shortcut is in the user profiles desktop I have been using batch files and dos variables to locate the current logged on user ect.

I have discovered the macros in auto-it, but have never used them before. Here's what I have at the moment:

FileMove("@DesktopCommonDir\shortcut.lnk", "@AppDataCommonDir\Microsoft\Internet Explorer\QUICK LAUNCH\")

Now by looking at the help file I assume @DesktopCommonDir should give me the c:\documents and settings\all users\desktop path and the @AppDataCommonDir should give me C:\Documents and Settings\All Users\Application Data

needless to say, it don't work. can anyone help me?

Thanks!

<{POST_SNAPBACK}>

The problem is you didn't concatenate. Your file move is reading everything as one string not a macro concatenated with a string. Try the following:

FileMove(@DesktopCommonDir & "\shortcut.lnk", @AppDataCommonDir & "\Microsoft\Internet Explorer\QUICK LAUNCH\")

Share this post


Link to post
Share on other sites
Xenobiologist

Hi,

I also had a similarly problem. Don´t forget the correct ending of the filename.

;Long way

$1 = @DesktopDir & "\vmware.exe.lnk"

$2 = @AppDataDir & "\Microsoft\Internet Explorer\Quick Launch\vmware.exe.lnk"

FileMove($1, $2)

;short way

FileMove(@DesktopDir & "\vmware.exe.lnk", @AppDataDir & "\Microsoft\Internet Explorer\Quick Launch\vmware.exe.lnk")

;check

MsgBox(0, @DesktopDir & "\vmware.exe.lnk", $1)

MsgBox(0, @AppDataDir & "\Microsoft\Internet Explorer\Quick Launch\vmware.exe.lnk", $2)

I used vmware.lnk instead of vmware.exe.lnk :whistle:

So long,

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites
MHz

I used vmware.lnk instead of vmware.exe.lnk  :whistle:

So long,

Mega

<{POST_SNAPBACK}>

So VMWare use vmware.exe as the name of their shortcuts, that is weird.

@possy_99

Your problem is that you are not concatenating the code.

Your code

FileMove("@DesktopCommonDir\shortcut.lnk", "@AppDataCommonDir\Microsoft\Internet Explorer\QUICK LAUNCH\")

should be to add the blue parts and remove the red parts.

FileMove("@DesktopCommonDir & "\shortcut.lnk", "@AppDataCommonDir & "\Microsoft\Internet Explorer\QUICK LAUNCH\")

Oh, I see AutoITPimp shows this, I am just too slow. :dance: Edited by MHz

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.