csccmd install or copy?

P

Patricia D

On my PC, I have successfully installed the Windows 2003 Resource Kit Tools
and used csccmd /disconnect:\\<server>\<share> to disconnect my offline
files (and all other network connections). This allows me to work on the
offline copies of all files, while still retainnig my live network connection
for email updates.
(Very useful for working out of the office on slow connections.)
When offline files are disconnected, the Synchronisation Manager icon
appears in the Windows System Tray, so it is easy to reconnect and
synchrinise the files,
if/when required.

PROBLEM: I'd like to use this utility on other PCs in our company, but I
don't want to install the complete Windows resource tools kit on other PCs.
If I simply copy the csccmd.exe file to another PC and run it in a cmd
window, the response is that it ran successfully, but no synch mgr icon
appears and all my network files are still available, so I have obviously NOT
disconnected the client side caching.
(I've tried copying the file to the C:\ directory, C:\Windows,
C:\Windows\Drivers, and C:\Windows\System32 folders - all with same result).

question: How can I install (only) csccmd.exe to a PC?

I've spent hours on this, so I'd really appreciate helpful suggestions....
 
H

hal

You should be able to just copy it and run the command, there is no
need to install.

In fact you don't even have to copy it, we run the tool from a network
share via vbscript without even having a copy locally, this works
great, you could modify this script. There is no reason however why it
wouldn't work locally, if you can open a command prompt and run it
without error (e.g. view the help) - it should run fine.

' csccmd.vbs script
' (c) Hal Sclater 30/06/09
' VBScript to update offline folders cache for file migration
' --------------------------------------------------------------

'Disable this for debugging
on error resume next

'Modify these 2 lines only...
source=\\oldserver\share 'Must exist.
destination=\\newserver\share 'Destination directory.
Do not use trailing \

'==========================================================
' Set file system objects
'==========================================================
Set objFSO = CreateObject("Scripting.FileSystemObject")
ParentFolder = objfso.GetParentFolderName(Wscript.ScriptFullName)
Set objNetwork = wscript.CreateObject("wscript.network")
Set wshShell = WScript.CreateObject( "WScript.Shell")

'==========================================================
' Set string variables
'==========================================================
Const Writable = 2
timenow = Replace(time,":",".") & "." & Replace(date,"/",".")
logfilename=ParentFolder & "\Logs\" & objNetwork.Username & "." &
Wscript.ScriptName & "." & timenow & ".txt" 'Location of logfile,
this will be created in the same location that the script is run
'WScript.Echo logfilename
Set objNetwork = wscript.CreateObject("wscript.network")

'==========================================================
' Try to create log file
'==========================================================
Err.Clear
Set objLogFile = objFSO.CreateTextFile( logFileName )
If Err.Number <> 0 Then
Err.Clear
' WScript.Echo "Unable to create log file for writing: " &
logfileName
WScript.Quit
End If

'==========================================================
' Subroutine to close the log file
'==========================================================
Sub closeLogFile
objLogFile.Close
End Sub

'==========================================================
'Run the script and output progress, use cscript to avoid pressing OK
'==========================================================
user = "User:" & objNetwork.Username
computername = wshShell.ExpandEnvironmentStrings( "%COMPUTERNAME%" )
row = "Updating files cached in " & source & " to " & destination
objLogFile.WriteLine(time & " " & date)
objLogFile.WriteLine(user)
objLogFile.WriteLine("Computername: " & computername)
objLogFile.WriteLine(row)
wscript.echo row

strCSCCMD = "cmd /c \\newserver\Scripts\CSCCMD\csccmd.exe /MOVESHARE:"
& Chr(34) & source & Chr(34) & " " & Chr(34) & destination & Chr(34) &
">>" & logfilename
' Create shell object
Set Wshshell = CreateObject("WScript.Shell")

'This line useful for debugging - outputs the command line used for
copy
'wscript.echo strCSCCMD
row = "Command used was: " & strCSCCMD
objLogFile.WriteLine(row)
closeLogFile

' Here is the CSCCMD line - Change between 0 and 1 to show dos window
Wshshell.Run strCSCCMD, 0, true

Call LogEvent("Updated Client Side Cache - " & User & " .
Description : " & strCSCCMD, 0)
' Use LogEvent to create an event log entry to report status
Sub LogEvent(strMessage, intEventType)

' Values for EventType:
' EVENT_ERROR = 1
' EVENT_INFORMATION = 4

Dim objWSH
Set objWSH = CreateObject("WScript.Shell")
objWSH.LogEvent intEventType, WScript.ScriptName & ": " & strMessage

End Sub 'LogEvent

wscript.echo "Done"

WScript.Quit
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top