954,582 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Dos Commands in VB6

Hi All,

I have a few dos commands that I would like to run / hardcode into my vb6 application

my .bat file starts like this

@echo off
set drive=e:\Backup\
set backupcmd=xcopy /s /c /d /e /h /i /r /y

I am setting the drive location using set drive=e:\Backup\
the running the backup command using set backupcmd=xcopy /s /c /d /e /h /i /r /y

then my first command is
echo Backing up My Documents
if not exist "%drive%\%UserName%\My Documents" mkdir "%drive%\%UserName%\My Documents"
%backupcmd% "%USERPROFILE%\My Documents" "%drive%\%UserName%\My Documents"
echo Completed backup of my documents

second command
third command
4th
5th
6th

In vb6 i am using the following to run the commands
Dim sbkuCommand As String
sbkuCommand = "C:\3tbu.bat"
Shell "cmd /c " & sbkuCommand, vbHide

What I would like to do is hard code the dos commands into the vb code ?

How is this possible please.

LloydFarrell
Junior Poster
101 posts since Dec 2009
Reputation Points: 10
Solved Threads: 0
 

Check out the Dir Function, the MkDir Statement, and the FileCopy Statement...


Good Luck

vb5prgrmr
Posting Virtuoso
1,912 posts since Mar 2009
Reputation Points: 156
Solved Threads: 296
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: