Page 1 of 1 1
Topic Options
#159992 - 2006-03-29 06:53 PM Adding folder to remote machine
Dmartin05 Offline
Fresh Scripter

Registered: 2006-02-01
Posts: 49
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.

Top
#159993 - 2006-03-29 11:18 PM Re: Adding folder to remote machine
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
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



Edited by Witto (2006-03-30 12:06 AM)

Top
#159994 - 2006-03-30 04:28 AM Re: Adding folder to remote machine
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11623
Loc: CA
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.

Top
#159995 - 2006-03-30 08:56 AM Re: Adding folder to remote machine
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
True,
But I think it can be used p.e. during logon

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 259 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.055 seconds in which 0.023 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org