Question to scripting gurus

deca300

Well-Known Member
Joined
Jan 28, 2010
Messages
138
Reaction score
0
Hi guys

I dont know much about scripting.

Can anyone please explain to me how this gets done?

I want to copy a small .exe from a server:
for example: \\192.168.10.5\shares\apps\lock.exe

to every desktop in my domain, I have 45 PC's in the domain.

How would I go about doing this? I know this can work using the logon script, Or is there a way to do this using GP ?

Any help much appreciated :)
 
You'll be better off configuring your startup script in your group policy to do it for each of the computers logging onto your domain.

If you have all the computer names, it'll be possible to run a relatively simple Powershell script that will call each computer name form a CSV file and execute the copy to each of the machines, but the group policy route will be a lot better and more reliable.
 
You can add a login script to your group policy that will run next time the user/computer logs in.

Put something like this in the script file:

Code:
copy "\\NAS\Software\example.exe" "%USERPROFILE%\Desktop"

Obviously this will copy the file every time the user logs in, you could either disable the script after it's done it's job or add a logoff/shutdown script to remove the file at logoff.
 
You can add a login script to your group policy that will run next time the user/computer logs in.

Put something like this in the script file:

Code:
copy "\\NAS\Software\example.exe" "%USERPROFILE%\Desktop"

Obviously this will copy the file every time the user logs in, you could either disable the script after it's done it's job or add a logoff/shutdown script to remove the file at logoff.

Better option :

Code:
 if not exist "C:\example.exe" goto Action1

goto Action2

:Action1

xcopy /y /e "\\fileserver\example.exe*" c:

c:\example.exe /q (or “/S”, silent installation, you should check whether your .exe file support silent installation)

exit

:Action2

Exit

From here : http://social.technet.microsoft.com...d3756/script-to-copy-and-execute-a-batch-file
 
Thank you imranpanji & DrJohnZoidberg =) Was looking for something like this. Should be able to make this work!
 
Thank you imranpanji & DrJohnZoidberg =) Was looking for something like this. Should be able to make this work!

Just note that the script will run the app that was copied automatically, so if you don't want that to happen remove that line
 
Hmmm I see yes, All I want to do is place a copy on their desktops. Not run anything.
 
From past experience, copying the file from the server to the user's desktop using an admin account, can be troublesome sometimes, especially with Win7, some PCs despite of the effort to keep their configs the same, refuses access

I would put the copy script into the logon script as shown above, so when the PC logs on and it runs the script it copies the data.
Aslo make sure that when it copies it either overwrites the existing file or ignore it without expecting the user's input.

I would also add create a network share, where everyone has access to and add a line that creates a directory I.E
mkdir \\Servername\Share\%USERNAME%

So the next day when everyone logs on after their script copied all the data it creates a directory in the share that everyone has access to so that you have some sort of confirmation to see who was able to run the script.

To hurry it i used to send users an email with with a click-able link to the script i want to run.
 
goto, now there is a command I have not seen in a very very long time! :erm:
 
Top
Sign up to the MyBroadband newsletter
X