• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Need to make a .vbs file and NEED HELP

Karsten

Platinum Member
I need to create a vbs that accomplishes basicaly the same as this DOS batch:

@echo off
echo.
echo This batch program
echo makes a backup of
echo all VMWARE images
echo.
echo Then hides the
echo Backup Folder
echo.
echo.
pause

XCOPY d:\vmware d:\vmbackup /e /i
XCOPY e:\vmware e:\vmbackup /e /i

attrib +H d:\vmbackup
attrib +H e:\vmbackup

@echo off
echo Your Backup
echo has been made!
echo.
echo Have a nice day!
echo.

Now... I have tried to the best of my ability to find some help online but it isn't working at all. Nor is it anywhere to complete. Here is what I have in vbs (or so I thought) so far:
' Backup Operation of VMWARE Images on second drive
' *****************************************************
' VMBACKUP.VBS Version 1.0
' Changes:
' *****************************************************

' *****************************************************
' Find second available drive D or E
' *****************************************************






' *****************************************************
' Create a backup Directory on second drive
' *****************************************************

' Deleting/Making Directories

Public Sub MakeDir(DirPath As String)
'Make a directory
On Error GoTo Error
MkDir DirPath$
Exit Sub
error: MsgBox Err.Description, vbExclamation, "Error"
End Sub



' *****************************************************
' Copy Directory
' *****************************************************

Public Sub CopyFile(StartPath As String, EndPath As String)
'Copy a file
On Error GoTo error
FileCopy StartPath$, EndPath$
Exit Sub
error: MsgBox Err.Description, vbExclamation, "Error"
End Sub




' *****************************************************
' Hide VMBackup Directory
' *****************************************************






' *****************************************************
' Output result action via text
' *****************************************************

Function EchoText(Text As String, Reverse As Boolean)
'This will "echo" the text, like this: Cool ool ol l
On Error GoTo error
Dim i As Long
Dim endstr As String
For i = 1 To Len(Text$)
If Reverse = True Then
endstr$ = Mid$(Text$, i, Len(Text$) - (i - 1)) & " " & endstr$
Else
endstr$ = endstr$ & Mid$(Text$, i, Len(Text$) - (i - 1)) & " "
End If
Next i
endstr$ = Mid$(endstr$, 1, Len(endstr$) - 1)
EchoText = endstr$
Exit Function
error: MsgBox Err.Description, vbExclamation, "Error"
End Function



' *****************************************************
' Own Varibles from here on
' *****************************************************

Anyone able to help or come up with a vbs? Your help would be much appriciated!
 
Back
Top