Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Put a shortcut on all PCs on a domain?

Status
Not open for further replies.

cyberspace

Technical User
Aug 19, 2005
968
GB
I manage a 31 machine domain.

The office software system sometimes doesnt log out, forcing users to go into Task Manager and start killing off processes, or, usually, getting me over to sort it.

I wrote a simlpe batch scipt to kill the relevant processes and i was wanting to get it into everybodys desktop.

How can i do that?

Thanks!

'When all else fails.......read the manual'
 
Do you use a login script for your domain? You can put something in there that will copy/create it on the desktops. Something along the line of

COPY /Y "FILENAME" %HOMEPATH%\Desktop
 
Or copy the .bat file to a share location and send an email out to everyone and tell them to browse to:

file://server\share\file
 
A little off topic, my advice would be fixing the software, I don't think a killer script is an ellegant sollution.

Cheers,
Dian
 
Diancecht, I agree completely - it's a terrible solution, and one which should not be nesessary for a product of this scale. I'm not at all a fan of this software....very expensive yet poorly tested and incredibly unintuitive.

I have no control in it and despite many logged calls its never been resolved.

This is my easiest way to help users and get around the problem.

Thanks for the tips so far.

The users use the standard SBS Login Script.

Trojanman - that would not copy the script to the desktop would it? I would need to write a seperate script to copy the other script to the desktop first wouldnt i?

mpnut - would that then perform the copy action every time it logged in?

'When all else fails.......read the manual'
 
Hi Cyberspace

I'm not sure of SBS but under Active Directory users and computers on the domain controller, each user has a profile and this is where you can specify a logon script to use.

The logon script needs to be placed in \\<server>\NETLOGON share and then all client machines run the scripts from there.

The script can either be a batch script, or a script written in Windows Scripting Host which is essentially VBScript. What I would do is create a logon.bat and then copy your "force kill" batch file from there to the client machine and then run a line like this in the logon script.

Doing it this way, users get the newest batch file whenever they log on. If you make a change to the batch file, you don't have to worry about to the redistibution. You could do this all in a batch file as well, but I do other things in my logon script that needs the windows scripting host.

wshShell.Run "xcopy "\\SERVER\Share\shutdown.bat" c:\shutdown.bat /d /y", TRUE

SET oFSO = Wscript.CreateObject("Scripting.FileSystemObject")
strDsk = WshShell.SpecialFolders("Desktop")
' What is the label for the shortcut?
strshortcut = strDsk & "\shutdown.lnk"
If Not oFSO.FileExists(strshortcut) Then
SET oUrlLink = WshShell.CreateShortcut(strshortcut)
' What is the path to the shared folder?
oUrlLink.TargetPath = "c:\shutdown.bat"
oUrlLink.Save
End If

 
opps... the line ' What is the path to the shared folder?
should be in your case:

' What is the path to the shutdown batch file?

(I use mine to create a shortcut to a network share used by everyone.)
 
You can dynamically create the shortcut using a tool like:

I use the above tool to create a shortcut to an access application as I've found that simply copying the shortcut sometimes links it back to the machine name it was copied from.

You could also just distribute the batch file. Most shortcuts are about 1-2K in size - I imagine the batch file is probably less... I know that's not much in either case, but creating a shortcut for a batch file seems a little redundant to me.

You can push this script to clients using a logon script or by logging on to the domain and using a text file with a list of computer names. For example, assume "computers.txt" has a list of your workstations:

Code:
for /f "tokens=*" %a in (computers.txt) do if not exist "\\%a\c$\documents and settings\all users\desktop" copy \\server\share\path\to\batchfile.bat" "\\%a\c$\documents and settings\all users\desktop"
 
Could I go one further and copy it to the users Start Menu > All Programs?

Some users dont know how to get back to the desktop when there are programs open.

Silly, I know....

'When all else fails.......read the manual'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top