soze
Members-
Posts
14 -
Joined
-
Last visited
-
Thanks, I'm going to test it out. This was for a automatic backup of a external USB drive. I needed it to start backing up as soon as the drive is plugged in. I needed it to find the next available drive letter. I had made a small robocopy file but you have to assign a drive letter to the destination folder, only thing every user has different drive mappings so I needed the script to assign the drive letter and start the copy using the robocopy cmd. Thx again,
-
I'm trying to run an automatic backup, I have a external USB drive that has an autorun file that calls this script. I'm trying to copy the entire C:\ to the USB drive to a folder named, Backup Folder It errors out, Line 29 Char. 5
-
Trying to do an automatic backup when USB drive is plugged in, I'm using autorun to call the script but it doesn't seem to working. Option Explicit Dim objFSO: Set objFSO = CreateObject("Scripting.FileSystemObject") Dim objShell: Set objShell = CreateObject("Wscript.Shell") Dim colDrives: Set colDrives = objFSO.Drives Dim drive Dim drvbackup Dim errReturn For each drive in colDrives If objFSO.FileExists(drive & "\Autobackup.cmd") Then If Instr(1,drive,":\",1)>0 Then drvBackup = drive Exit For ElseIf Instr(1,drive,":",1)>0 Then drvBackup = drive & "\" Exit For Else drvBackup = drive & ":\" Exit For End If End If Next If drvBackup = "" Then msgbox "Cannot locate Autobackup.cmd on any of the drives attached to this computer" wscript.quit 3 Else errReturn = objShell.Run("robocopy.exe C:\ " & drvBackup & "BackupFolder /E /V /NP /ZB /R:3 /W:1",1,1) If errReturn <> 0 Then msgbox "Backup completed with the following error: " & errReturn Else msgbox "Backup completed successfully!" End If End If wscript.quit 0
-
Proper syntax to delete folder from Multiple Profiles
soze replied to soze's topic in How do you do....it?
I'm trying to delete the UCF directory under Documentum for every profile, so can I just change the sFolder= to UCF instead of Documentum? -
Does anyone know what Syntax is needed to delete a certain folder from every profile on a machine. exp. ' ------ SCRIPT CONFIGURATION ------ strFolderPath = "" ' e.g. "d:\temp" ' ------ END CONFIGURATION --------- set objFSO = CreateObject("Scripting.FileSystemObject") ObjFSO.DeleteFolder("C:\Documents and Settings\qt34064\Documentum\UCF") WScript.Echo "Successfully deleted folder" I want to remove it from Qt34065, Qt23404 and so on. How can I edit this in order for this to happen? Thx
-
I trying to edit this script so that it deletes the ucf folder instead of renaming it to .old. sDS="c:\documents and settings\" set oFolder=ofso.getfolder(sDS) for each oSubFolder in oFolder.subfolders DocumentumDir = sDS & oSu.name & "\Documentum\" If oFSO.folderExists(DocumentumDir & "ucf") Then If oFSO.folderExists(DocumentumDir & "ucf.old") Then oFSO.deleteFolder(DocumentumDir & "ucf.old") End If oFSO.MoveFolder DocumentumDir & "ucf" , DocumentumDir & "ucf.old" End If next
-
OK, so I just name this with a .vbs and replace this with the old file?
-
I'm trying to edit this script so that it clears the contents of the "UCF" directory for everyone who logs on the machine. Right now it only clears the current logged on user. Any help would be appreciated, I have very limited scripting knowledge. Dim objWSHShell :Set objWSHShell = CreateObject("WScript.Shell") Set objFSO = WScript.CreateObject("Scripting.FileSystemObject") DocumentumDir = ExpandEvnVariable("userProfile") & "\Documentum\" If objFSO.folderExists(DocumentumDir & "ucf") Then If objFSO.folderExists(DocumentumDir & "ucf.old") Then objFSO.deleteFolder(DocumentumDir & "ucf.old") End If objFSO.MoveFolder DocumentumDir & "ucf" , DocumentumDir & "ucf.old" End If ''_______________________________________________________________________________________________________________________________ Function ExpandEvnVariable(ExpandThis) ExpandEvnVariable = objWSHShell.ExpandEnvironmentStrings("%" & ExpandThis & "%") End Function
-
thanks for all the help, do I copy the script to the USB Drive? I have very little scripting knowledge.
-
Ok, and this will clear the target folder for anyone who logs on, correct.
-
I trying to changed this script so that it perfoms the action for all users instead of just the person that is logged on. What do I have to change the "userProfile" to? Thx for the Help Dim objWSHShell :Set objWSHShell = CreateObject("WScript.Shell") Set objFSO = WScript.CreateObject("Scripting.FileSystemObject") DocumentumDir = ExpandEvnVariable("userProfile") & "\Documentum\" If objFSO.folderExists(DocumentumDir & "ucf") Then If objFSO.folderExists(DocumentumDir & "ucf.old") Then objFSO.deleteFolder(DocumentumDir & "ucf.old") End If objFSO.MoveFolder DocumentumDir & "ucf" , DocumentumDir & "ucf.old" End If ''_______________________________________________________________________________________________________________________________ Function ExpandEvnVariable(ExpandThis) ExpandEvnVariable = objWSHShell.ExpandEnvironmentStrings("%" & ExpandThis & "%") End Function
-
I wish it could be that easy, it has to be automatic; no user interaction other then plugging in the USB drive. Thanks for the suggestion.
-
Thanks for the quick response guys, removed the *.* and the quotes and everything worked. Would any of you be familiar with the Auto Run command, I would like for this Robocopy string to be executed when a external USB drive is inserted into the machine with no user interaction. Thanks for all the Help!
-
I'm trying to backup the entire C drive to an external USB drive using Robocopy, what would the correct syntax be: robocopy "C:\*.*" "D:\BackupFolder" /E /V /NP /ZB /R:10 /W:30 doesn't seem to be working.

