| |
drh
Posts: 6
Score: 0
Joined: 5/31/2005
From:
Status: offline
|
I'm trying to automate a backup routine and I must perform certain tasks, in sequential order. One of these is to shut down a FoxPro database, which resides on another machine, perform B/U then restart the FP db. I'm using the Windows scheduler on a server to start a vbs. Here is the code I'm trying to use. Dim Controller, RemoteScript Set Controller = WScript.CreateObject("WSHController") Set RemoteScript = Controller.CreateScript("I:\AdminScripts\StartNote.vbs", "Report") WScript.ConnectObject RemoteScript, "remote_" RemoteScript.Execute Do While RemoteScript.Status <> 2 WScript.Sleep 100 Loop WScript.DisconnectObject RemoteScript Sub remote_Error Dim theError Set theError = RemoteScript.Error WScript.Echo "Error " & theError.Number & " - Line: " & theError.Line & ", Char: " & theError.Character & vbCrLf & "Description: " & theError.Description WScript.Quit -1 End Sub And here is the script it is calling. (I:\AdminScripts\StartNote.vbs) Dim objShell Set objShell = CreateObject("Wscript.Shell") objShell.Run "C:\WinNt\NotePad.exe", 3, False I want the script to launch the remote application in a visible mode. That is why I am using a parameter 3, Window Maximized. What I am getting is the application running as a process only, no GUI. If I go to the machine where the remote application is and run the local script it functions as it should, window maximized. What am I missing? I figure, if I can get NotePad to work, I can get my FoxPro app to work as well. I've also tried to use SysInternals PSExec to launch my FP app but the remote computer returns a message that a dll is corrupt or missing. I think using WHSController is going to be my best option, if I can get it to work. Any ideas? Thanks drh
|
|