Jump to content
Sign in to follow this  
Jarrod

Copy NetHood Object to Desktop

Recommended Posts

Jarrod

Hi guys,

I have looked through here for a few days and haven't found a solution, so I thought I'd start a new thread.

My script opens the "Add Network Place" wizard on Windows XP and creates a WebDav folder supplying username, password, etc. All of that works great after some digging on CLSIDs and lots of trial and error.

The last step of my script needs to copy this network location to the desktop.

1.) I tried opening the network places folder, selecting the correct one and "Copy/Paste" from the Edit menu, but doesn't work.

2.) I tried creating a shortcut, but the network place seems like a shortcut itself and windows tries to open in a web browser because the link is "http://..."

3.) I tried

FileCopy( @HomeDrive & "\Documents and Settings\"& @UserName & "\NetHood\networklocationname", @DesktopDir, 9);
which works, but the new file is named "target" and it also creates a "Desktop.ini" file which is hidden.

4.) I've also tried DirCopy, FileMove and FileInstall (failed silently - no return value). I came back to FileCopy because it seems the closest to working.

Any idea how to change filenames in FileCopy or afterwards? I didn't see a 'FileRename' function. I have tried something like this:

FileCopy( @HomeDrive & "\Documents and Settings\"& @UserName & "\NetHood\networklocationname", @DesktopDir & "\filename", 9);

and

FileCopy( @HomeDrive & "\Documents and Settings\"& @UserName & "\NetHood\networklocationname", @DesktopDir & "filename", 9);

Share this post


Link to post
Share on other sites
JohnOne

Perhaps you could make a new file with _FileCreate() and name it what you want, then write the relevant data to it.

EDIT:

Infact read filemove in help file

Because AutoIt lacks a "FileRename" function, use FileMove to rename a file!

Edited by JohnOne

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites
Jarrod

Perhaps you could make a new file with _FileCreate() and name it what you want, then write the relevant data to it.

EDIT:

Infact read filemove in help file

Awesomeness... thank you. I looked at it earlier and for some reason couldn't get it to work, but this time it did!

FileCopy( @HomeDrive & "\Documents and Settings\"& @UserName & "\NetHood\filename", @DesktopDir, 9);
FileMove( @DesktopDir & "\target.lnk", @DesktopDir & "\filename.lnk");

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  

×