Login | |
|
 |
RE: Run multiple dos command in one session. URGENT!!! - 7/28/2006 3:46:28 AM
|
|
 |
|
| |
buffalokml
Posts: 15
Score: 0
Joined: 4/3/2006
Status: offline
|
thanks so much for your quick response I still have problem....here is my code. Could you please tell me what I'm missing here??????? Sub ReadSolutionFile(strFile) Dim strCurrentDir, strDeployDir Dim strCreateZipCmd Dim objShell Set objShell = CreateObject("WScript.Shell") Set objFSo = CreateObject("Scripting.FileSystemObject") set oFSO = objFSo.GetFile(strFile) set oStreamFile = oFSO.OpenAsTextStream(1,-2) myDate = split(Date, "/", -1, 1) myTime = split(Time, ":", -1, 1) strHrs = split(myTime(2), " ", -1 , 1) strDateTime = myDate(0) & "-" & myDate(1) & "-" & myDate(2) & "_" & myTime(0) & "-" & myTime(1) & "-" & strHrs(0) & "-" & strHrs(1) strDeployDir = strReleaseVer & "-" & strDateTime ExeCmd("md " & strDeployDir ) 'Loop thru text file line by line Do until oStreamFile.AtEndOfStream dim strReadLine, strCD strReadLine = Split(oStreamFile.ReadLine, "|", -1, 1) if strReadLine(2) = "NO CONF" then strZipFileName = strWorkingDir & "\" & strDeployDir & " " & strReadLine(0) & "-" & strReleaseVer & "-" & CONF & "-" & strDateTime & ".zip" & " " & strWorkingDir & "\" & strReadLine(1) & "\*" WScript.Echo objShell.CurrentDirectory WScript.Echo chr(34) & strWorkingDir & "\" & strReadLine(1) & chr(34) objShell.CurrentDirectory = chr(34) & strWorkingDir & "\" & strReadLine(1) & chr(34) WScript.Echo objShell.CurrentDirectory CreateZip strZipFileName else strZipFileName = strWorkingDir & "\" & strDeployDir & " " & strReadLine(0) & "-" & strReleaseVer & "-" & CONF & "-" & strDateTime & ".zip" & " " & strWorkingDir & "\" & strReadLine(1) & "\" & CONF & "\*" WScript.Echo objShell.CurrentDirectory objShell.CurrentDirectory = chr(34) & strWorkingDir & "\" & strReadLine(1) & CONF & chr(34) WScript.Echo objShell.CurrentDirectory CreateZip strZipFileName end if objShell.CurrentDirectory = strWorkingDir Loop oStreamFile.Close End Sub ================ If I run this code I got error: C:\Projects>CScript GenerateZip.vbs d a 6.8.0.007 Microsoft (R) Windows Script Host Version 5.6 Copyright (C) Microsoft Corporation 1996-2001. All rights reserved. Running command: md 6.8.0.007-7-28-2006_9-35-33-AM ************* Finished ***************** C:\Projects "C:\Projects\External Libraries\Infragistics61\aspnet_client" C:\Projects\GenerateZip.vbs(97, 9) (null): The filename, directory name, or volume label syntax is incorrect. ================== However, If I run with this code, it is working OK Dim WshShell Set WshShell = WScript.CreateObject("WScript.Shell") WScript.Echo WshShell.CurrentDirectory WshShell.CurrentDirectory = "C:\Projects\External Libraries\Infragistics61\aspnet_client" WScript.Echo WshShell.CurrentDirectory C:\vbscript>CScript ChangeDir.vbs Microsoft (R) Windows Script Host Version 5.6 Copyright (C) Microsoft Corporation 1996-2001. All rights reserved. C:\vbscript C:\Projects\External Libraries\Infragistics61\aspnet_client ***************************************************
|
|
| |
|
|
|
 |
RE: Run multiple dos command in one session. URGENT!!! - 7/28/2006 9:16:44 AM
|
|
 |
|
| |
DiGiTAL.SkReAM
Posts: 1194
Score: 7
Joined: 9/6/2005
From: Florida, USA
Status: offline
|
The error you showed says there is a problem with line 97. Correct that error, and you'll be ok. Sorry for the generality, but unless you post all of your code, I can't do much more.
_____________________________
"Would you like to touch my monkey?" - Dieter (Mike Meyers) "It is better to die like a tiger, than to live like a pussy." -Master Wong, from Balls of Fury
|
|
| |
|
|
|
|
|