Re: DSMADMC from Visual Basic Shell Function?
Hi I found an example on how to send cmds to a dos window. http://www.planet-source-code.com/xq/ASP/txtCodeId.3593/lngWId.1/qx/vb/scrip ts/ShowCode.htm Working with that example, i got the dsmadmc command to produce output to the -outfile. Kaj -Original Message- From: Fletcher, Leland D. [mailto:[EMAIL PROTECTED]] Sent: 6. februar 2001 17:44 To: [EMAIL PROTECTED] Subject: DSMADMC from Visual Basic Shell Function? I'm attempting to write a VB application to monitor the daily ADSM schedule and to issue several commands throughout the day. My problem is that when I use the shell command nothing seems to be working. I do not get any errors but I do not get any output either. The format of the shell command I'm using is provided below. I have not set any environment variables and plan on executing the VB application under Windows 2000. The following should issue the "q fi". Private Sub Command1_Click() x = Shell("C:\Progra~1\IBM\ADSM\saclient\DSMADMC.EXE -id=admin -pa=x -outfile=c:\cmdout.txt q fi") End Sub The function runs without error but I do not get the -outfile allocated. Thanks in advance for any input to my problem! Lee Fletcher Network Project Integrator AmerenUE Callaway Plant [EMAIL PROTECTED]
Re: DSMADMC from Visual Basic Shell Function?
Not so long ago I did write a VB script to create a small user interface. The script waits for the end of execution of the DSMADMC command. The problem I did not solve is the reception of the Return codes. The solution I found is that the script reads the outputfile of the DSMADMC command to see if everything has been executed as it should. For me this is not professional enough but it works. The script is something like this: (only an extraction of the function and the main subroutine) Public Function WaitCMD(ByVal JobToDo As String, Optional qResult) As Long . On Error Resume Next ProcessID = Shell(JobToDo, vbNormalFocus) If Err Then WaitCMD = vbObjectError + Err.Number Debug.Print "Shell Exec Error"; WaitCMD Exit Function End If On Error GoTo 0 hProcess = OpenProcess(fdwAccess, False, ProcessID) nRet = WaitForSingleObject(hProcess, INFINITE) Call CloseHandle(hProcess) Select Case nRet Case WAIT_TIMEOUT: Debug.Print "Timed out!" Case WAIT_OBJECT_0: Debug.Print "Normal completion." Case WAIT_ABANDONED: Debug.Print "Wait Abandoned!" Case WAIT_FAILED: Debug.Print "Wait Error:"; Err.LastDllError End Select .. End Function Sub Main() . TsmCmd = "select domain_name from domains" Ret = WaitCMD("dsmadmc.exe -id=" + UseNam + " -pa=" + Pwd + " -outfile=" + OuFil + " " + TsmCmd) . End Sub Hope this helps Michel "Fletcher, Leland D." [EMAIL PROTECTED] on 02/06/2001 05:43:35 PM Please respond to "ADSM: Dist Stor Manager" [EMAIL PROTECTED] To: [EMAIL PROTECTED] cc:(bcc: Michel Engels/BE/Devoteam) Subject: DSMADMC from Visual Basic Shell Function? I'm attempting to write a VB application to monitor the daily ADSM schedule and to issue several commands throughout the day. My problem is that when I use the shell command nothing seems to be working. I do not get any errors but I do not get any output either. The format of the shell command I'm using is provided below. I have not set any environment variables and plan on executing the VB application under Windows 2000. The following should issue the "q fi". Private Sub Command1_Click() x = Shell("C:\Progra~1\IBM\ADSM\saclient\DSMADMC.EXE -id=admin -pa=x -outfile=c:\cmdout.txt q fi") End Sub The function runs without error but I do not get the -outfile allocated. Thanks in advance for any input to my problem! Lee Fletcher Network Project Integrator AmerenUE Callaway Plant [EMAIL PROTECTED]
Re: DSMADMC from Visual Basic Shell Function?
Can you just redirect the output? I don't know VB, but I'm thinking it should work: Private Sub Command1_Click() x = Shell("C:\Progra~1\IBM\ADSM\saclient\DSMADMC.EXE -id=admin -pa=x q fi c:\cmdout.txt") End Sub Nick Cassimatis [EMAIL PROTECTED] "I'm one cookie away from happy." - Snoopy (Charles Schulz)
DSMADMC from Visual Basic Shell Function?
I'm attempting to write a VB application to monitor the daily ADSM schedule and to issue several commands throughout the day. My problem is that when I use the shell command nothing seems to be working. I do not get any errors but I do not get any output either. The format of the shell command I'm using is provided below. I have not set any environment variables and plan on executing the VB application under Windows 2000. The following should issue the "q fi". Private Sub Command1_Click() x = Shell("C:\Progra~1\IBM\ADSM\saclient\DSMADMC.EXE -id=admin -pa=x -outfile=c:\cmdout.txt q fi") End Sub The function runs without error but I do not get the -outfile allocated. Thanks in advance for any input to my problem! Lee Fletcher Network Project Integrator AmerenUE Callaway Plant [EMAIL PROTECTED]
Re: DSMADMC from Visual Basic Shell Function?
The pro version of VB comes bundles with Access, yes? You may want to get Access connected and build your queries, then build your VB interface on top of that. [EMAIL PROTECTED] 02/06/01 11:43AM I'm attempting to write a VB application to monitor the daily ADSM schedule and to issue several commands throughout the day. My problem is that when I use the shell command nothing seems to be working. I do not get any errors but I do not get any output either. The format of the shell command I'm using is provided below. I have not set any environment variables and plan on executing the VB application under Windows 2000. The following should issue the "q fi". Private Sub Command1_Click() x = Shell("C:\Progra~1\IBM\ADSM\saclient\DSMADMC.EXE -id=admin -pa=x -outfile=c:\cmdout.txt q fi") End Sub The function runs without error but I do not get the -outfile allocated. Thanks in advance for any input to my problem! Lee Fletcher Network Project Integrator AmerenUE Callaway Plant [EMAIL PROTECTED]
Re: DSMADMC from Visual Basic Shell Function?
Shell environments set (dsm_dir, dsm_config, path) ? I am not a vbs expert, but I can do this with cscript: testcmd="dsmadmc -id=admin -pa=pw -outfile=test.out " + arg0 set wshshell=wscript.createobject("wscript.shell") wshshell.run testcmd,0,True -Original Message- From: Fletcher, Leland D. [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 06, 2001 11:44 AM To: [EMAIL PROTECTED] Subject: DSMADMC from Visual Basic Shell Function? I'm attempting to write a VB application to monitor the daily ADSM schedule and to issue several commands throughout the day. My problem is that when I use the shell command nothing seems to be working. I do not get any errors but I do not get any output either. The format of the shell command I'm using is provided below. I have not set any environment variables and plan on executing the VB application under Windows 2000. The following should issue the "q fi". Private Sub Command1_Click() x = Shell("C:\Progra~1\IBM\ADSM\saclient\DSMADMC.EXE -id=admin -pa=x -outfile=c:\cmdout.txt q fi") End Sub The function runs without error but I do not get the -outfile allocated. Thanks in advance for any input to my problem! Lee Fletcher Network Project Integrator AmerenUE Callaway Plant [EMAIL PROTECTED]