Dynamic-CD
Search : 
  Powered by FindinSite

• Examples home
• Getting started
• Automated encryption
• Compare ASP servers
• Cookies test centre
• Database browser
• Menuing system
• Office Web Components
• Searching CDs
• SecureCD
• Shopping cart
• Slide show
• Sync demo
• Timed passwords
• User entry control

• ASP support
• Database CDs
• Evaluation download

• Case studies
• Examples
• FAQ
• Features
• License and pricing
• What they say
    
Automating CD production

For Professional and Consultancy Licence holders, the script method  Server.EncryptFile can be used to automate the production of password - protected CDs.

While Dynamic-CD-Wizard does most of the work of creating CD images, if you need to produce a number of CDs with different usernames and passwords, you could use the following technique.

  1. Use Dynamic-CD-Wizard to create a CD image, but don't password protect any files (although script files can be encrypted as usual).
  2. Modify and run a script based on the script below to create output image directories, copying the Dynamic-CD-Wizard image to final directories, password-protecting the files as you go.
Note that Strong Passwords are enforced.
<%
  ' copy a Dynamic-CD image directory to a final directory
  ' password protecting all HTML files en route

  ' folder names (must terminate with \)
  imageDir = "\test.img\"
  finalDir = "\test.fin\"
  overWriteImage = TRUE

  SET fso = Server.CreateObject( "Scripting.FileSystemObject")

  ' check existence
  IF NOT fso.FolderExists( imageDir)  THEN
    Response.Write "<BR>imageDir doesn't exist - "+imageDir
    Response.End
  END IF

  IF fso.FolderExists( finalDir) THEN
    Response.Write "<BR>finalDir exists already - "+finalDir
  IF NOT overWriteImage THEN
    Response.End
  END IF
  ELSE
    fso.CreateFolder( finalDir)
  END IF

  SET fol = fso.GetFolder( imageDir)
  SET fic = fol.Files
  SET fold = fso.GetFolder( imageDir)
  SET sfoc = fold.SubFolders

  ' copy the dyncd subfolder
  IF NOT fso.FolderExists( imageDir+"\dyncd") THEN
    Response.Write "<BR>dyncd folder doesn't exist"
    Response.End
  ELSE
    Response.Write "<BR>copying <B>"+imageDir+"dyncd"+"</B>"
    Response.Write " to <B>"+finalDir+"dyncd"+"</B>"
  fso.CopyFolder imageDir+"dyncd", finalDir+"dyncd", TRUE
  END IF

  IF sfoc.Count > 1 THEN
    Response.Write "<BR>Warning - can't process subfolders "
    Response.Write "other than <B>dyncd</B>"
  END IF

  ' copy and encrypt files individually
  ' (doesn't handle subfolders other than dyncd)
  ' password protect HTML files
  Response.Write "<P><B>Ecrypting and coping:</B>"
  FOR EACH fi IN fic
    ext = lcase( right( fi.shortname, 4))
    IF ext = ".htm" THEN
      Response.Write "<BR>encrypting "+ imageDir+fi.name
      Response.Write " to "+finalDir+fi.name
      Server.EncryptFile imageDir+fi.name, finalDir+fi.name, _
  	                "user#1", "passwd#1"
    ELSE
      Response.Write "<BR>NOT encrypting "+fi.name
      fso.CopyFile imageDir+fi.name , finalDir+fi.name, TRUE
    END IF
  NEXT
%>


© Copyright 2000-2007 PHD Computer Consultants Ltd