Distributing Sub-Folders when Copying ConsoleOne
Novell Cool Solutions: Trench
By Marcus Westlund
|
Digg This -
Slashdot This
Posted: 12 Mar 2003 |
Recently we published this Q&A:
Question: Jody G. wrote: I am trying to create an application object that will copy \\servername\sys\public\mgmt\consoleone\*.* (including subfolders & files) to c:\novell\consoleone (including subfolders and files) if the server version is newer. Once this is done I want it to run ConsoleOne from the PC.
The problem I have is that Distribution Options for Application Files doesn't seem to copy/create the full folder structure using wild cards.
Is there a way I can do this?
Answer: Yes - use a distribution script in ZfD4.
Other Suggestion
Marcus Westlund of the Swedish Police had a better idea. Here's what he said:
I have a tip regarding Jody G's problem. I am using a VB-script and the file copy utility robocopy.exe to copy the ConsoleOne file structure from Z: (a Sys:public root mapping) to C:\Novell\ConsoleOne.
Use a application object to copy C1copy.cmd, ConsoleOne.vbs and robocopy.exe to C:\Novell\ConsoleOne, then execute the script from same application object.
---------------
ConsoleOne.vbs
---------------
' * Filename: ConsoleOne.vbs
' * Marcus Westlund, The Swedish Police, 2003-01-24
' *
' * This script will copy ConsoleOne files and directories
from Z: to C: and then it
' * will start ConsoleOne from the local drive.
' *
' * This file may be distributed with an application
object to C:\Novell\ConsoleOne.
' * Let the application object then execute the script.
If you have problem to start .vbs files from NAL
' * you can enter following in the application object:
' * Path to file: %*WinSysDir%\cmd.exe
' * Parameters: /C C:\Novell\ConsoleOne\ConsoleOne.vbs
' * Working Dir: C:\Program\ConsoleOne
' *
' *
' * The copy process requires the file C1copy.cmd.
' *
Option Explicit
On Error Resume Next
Dim objFile
Dim objShell
Dim sKopiera
Dim oExec
Dim objArgs
Dim oExe
Dim oExecTwo
'* create objects.
Set objShell = WScript.CreateObject("WScript.Shell")
Set objFile = CreateObject("Scripting.FileSystemObject")
Set objArgs = WScript.Arguments
'* Ask if the files should be synchronized (with
C1copy.cmd)
sKopiera = objShell.Popup("Do you want to copy/synchronize
ConsoleOne to your local disk?",10,"Synchronize files...",4+32)
Select Case sKopiera
'If Case 6 (Yes): The files will be copied and then
ConsoleOne starts
Case 6
Set oExec = objShell.Run("C:\Novell\
ConsoleOne\C1copy.cmd", 1, True)
Set oExecTwo = objShell.Run("C:\Novell\
ConsoleOne\Bin\ConsoleOne.exe", 1, True)
' If Case 7 (No): ConsoleOne starts whitout
any file copying
Case 7 Set oExec = objShell.Run("C:\Novell\
ConsoleOne\Bin\ConsoleOne.exe", 1, True)
' If Case -1 (no answer): ConsoleOne starts
without any file copying
Case -1 Set oExec = objShell.Run("C:\Novell\
ConsoleOne\Bin\ConsoleOne.exe", 1, True)
End Select
Wscript.Quit
-------- EOF --------------
---------------------
C1copy.cmd
----------------------
@ECHO OFF
REM Filename: c1copy.cmd
REM Requires the copy utility robocopy.exe
REM Copies ConsoleOne files from Z:, which should be a
root search mapping to sys:public
:START
TITLE Copying files to C:\Novell\ConsoleOne...
ROBOCOPY Z:\mgmt\ConsoleOne\1.2
C:\Novell\ConsoleOne *.* /E /R:3 /W:30
EXIT
:END
-------- EOF ------------
If you have any questions you may contact Marcus at marcus.westlund@teknik.police.se
Novell Cool Solutions (corporate web communities) are produced by WebWise Solutions. www.webwiseone.com

