|
-
Aug 29th, 2000, 04:52 AM
#1
Thread Starter
Addicted Member
Hi,
I have the following script in a batch file:
rem Extracts source code from sourcesafe
rem set sourcesafe database
set ssdir=\\path to server
set path=%path%;c:\program files\Microsoft Visual Studio\common\vss\win32;c:\program files\microsoft visual studio\vb98
rem destroy old extract folder and extract sourcesafe code into there
cd c:\
attrib -r c:\extract /s
del c:\extract /s /q
mkdir c:\extract
cd c:\extract
ss get $/ -R -I-N
what I would like to know is: Is it possible to run these commands from VB without the need for the batch file?
Thanks in advance,
Shaun
Web/Application Developer
VB6 Ent (SP5), Win 2000,SQL Server 2000
-
Aug 29th, 2000, 06:45 AM
#2
Thread Starter
Addicted Member
Really struggling
Hi again,
I have searched everywhere and it seems that I cannot do the above! However, can I pass a parameter to a batch file through VB and then how do I access that parameter within the batch file.
ie:
Code:
'execute the batch file with parameter Sitename
iShell = Shell("C:\Build.bat %Sitename%")
Any help will be appreciated
Shaun
Web/Application Developer
VB6 Ent (SP5), Win 2000,SQL Server 2000
-
Aug 29th, 2000, 07:04 AM
#3
Is the %sitename% saved in a string variable or is it a environment variable?
If it's the earlier do this:
Code:
Call Shell("C:\build.bat " & sSiteName, vbNormalFocus)
Otherwise do this:
Code:
Call Shell("C:\build.bat " & Environ("SiteName"), vbNormalFocus)
In the BAT file use %1 to get the first argument. (%2 for the second and so on)
Good luck!
-
Aug 29th, 2000, 07:13 AM
#4
Thread Starter
Addicted Member
Thanks Joacim,
Sitename will just be a String Variable from VB. It works fine with:
Code:
call shell ("C:\build.bat" & strSiteName, vbNormalFocus)
Just one more question though if you don't mind:
what is an environment variable? (is it like a global/local?)
thanks again
Shaun
Web/Application Developer
VB6 Ent (SP5), Win 2000,SQL Server 2000
-
Aug 29th, 2000, 07:19 AM
#5
No environment variables is mostly used in DOS.
Path, ComSpec and Temp are maybe the most used.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|