Dmartin05
(Fresh Scripter)
2006-03-29 06:53 PM
Adding folder to remote machine

Hey Everyone,

I currently have a url with an icon that i need to place on everyone's desktop.
Almost everyone in the company has a folder called IS in there c:. I want write a remote script that will verify if the C:\IS folder is there, if it is leave alone and if it's not to create it. I then want to copy the URL to the desktop.

I know that I can use the If Exist,MD,and copy cmd to get what I want, but I just don't know how to put them together in order for them to work. I want to be able to execute the script from my desk not through login.


Witto
(MM club member)
2006-03-29 11:18 PM
Re: Adding folder to remote machine

Maybe this works?
Code:
If NOT @LOGONMODE
Break On
EndIf

Dim $strDesktop, $strPrograms, $Junk
; If the folder C:\IS\ does not exist
If NOT Exist("C:\IS\")
; Create it
MD "C:\IS\"
; Create Shortcut, problem: created in active program group
$Junk = AddProgramItem("C:\IS","IS","",1,"C:\IS\")
; The shortcut is created in the all users start menu, this is the path
$stPrograms = ReadValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders","Common Programs")
; It should be on the desktop, this is the path
;$strDesktop = ReadValue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders","Desktop")
$strDesktop = ReadValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders","Common Desktop")
; Move the shortcut
Move $strPrograms+"\IS.lnk" $strDesktop
EndIf



NTDOCAdministrator
(KiX Master)
2006-03-30 04:28 AM
Re: Adding folder to remote machine

Nope that won't work. It does not even attempt to look at a remote system.

If I get time I'll find a post that does it, or post some code here to address it. Though I know it's already been posted not too long ago.


Witto
(MM club member)
2006-03-30 08:56 AM
Re: Adding folder to remote machine

True,
But I think it can be used p.e. during logon