Click here to Skip to main content
15,886,199 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
What I would like to know is how can I write a code to use a batch program but conver it to VB 2010 application.. I will show you the Batch code..

"@echo off

::UEC Cleanup utility by Dave Laroche 7/1/2011


:: Set the Backup home drive letter
cls
echo.
echo.
echo UEC Backup DRIVE LETTER
echo.
echo.
echo Enter the drive letter
echo where the UECBackup folder
echo is to be located
echo.
echo.
set /p userinp= UEC Backup Drive Letter:
set DRIVE=%userinp:~0,1%

:: Set the MEMR Wizard install drive letter
cls
echo.
echo.
echo MEMR Wizard DRIVE LETTER
echo.
echo.
echo Enter the drive letter
echo where the MEMR folder
echo is located from the Wizard
echo.
echo.
set /p userinp= MEMR Wizard Drive Letter:
set Wizard=%userinp:~0,1%

MD %drive%:\UECBackup

:: --copy files from wizard backup to the cleanup location

xcopy /y %wizard%:\MEMR\MigrationTool\DBBackups\*.bak %drive%:\UECBackup\*.bak
DEL /Q /F %wizard%:\MEMR\MigrationTool\DBBackups\*.bak

xcopy /y %wizard%:\MEMR\MigrationTool\UECBackups\*.bak %drive%:\UECBackup\*.bak
DEL /Q /F %wizard%:\MEMR\MigrationTool\UECBackups\*.bak

:: --create SQL backups of the DMZ databases

cls
echo.
echo.
echo The SQL backups of the DMZ databases is now running...
echo.
echo This will take some time...Please wait

SQLCMD -i DMZ_backup.sql -v BUPATH=%drive% -o DMZ_backup.log

:Backup
cls
echo.
echo.
echo SQL backup script complete
echo.
echo.
echo Did your SQL backups complete without error?
echo.
echo.
echo.
set /p userinp= (Y / N):
if "%userinp%"=="Y" goto CONTINUE else goto A1
:A1
if "%userinp%"=="y" goto CONTINUE else goto A2
:A2
if "%userinp%"=="N" goto END else goto A3
:A3
if "%userinp%"=="n" goto END else goto A4
:A4
cls
echo.
echo.
echo That was an invalid entry. Try again
echo.
echo.
ping -n 4 127.0.0.1 >nul
goto BACKUP

:CONTINUE

SQLCMD -i DMZ_Drop.sql -v BUPATH=%drive% -o DMZ_Drop.log

REM --WinRAR the sql BAK files and delete them

cls
echo.
echo.
echo The backups are now being compressed.....please wait
echo.
winrar M -ibck -afrar -ag -r %DRIVE%:\uecbackup\uecbackup.rar %DRIVE%:\uecbackup\*.*

:END
cls
echo.
echo.
echo The UEC Cleanup Utility is now complete
pause"

How can translate this into VB2010??
Posted

1 solution

How can translate this into VB2010??

Manually.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900