J
JonWayn
I have a VBScript script that is pretty simple: it opens a microsoft access
database. The problem is, it should open it hidden, with the second argument
to the wscript run command being 0, but it doesnt do so. Any suggestions?
Here's the script:
Const FOLDERPATH = "C:\Working\Access\All County\"
Const SCHEDULERFILE = "Scheduler.mdb"
Const LDBFILE = "Scheduler.ldb"
Const WINDOWVIEWSTATE_HIDE = 0
Const ERRPERMISSIONDENIED = 70
Set FSO = Wscript.CreateObject("Scripting.FileSystemObject")
On Error Resume Next
If FSO.FileExists(FOLDERPATH & LDBFILE) Then
FSO.DeleteFile FOLDERPATH & LDBFILE
If Err.Number = ERRPERMISSIONDENIED Then
Wscript.Echo "Scheduler already running"
Wscript.Quit
End If
End If
set objShell = Wscript.CreateObject("Wscript.Shell")
objShell.Run """" & FOLDERPATH & SCHEDULERFILE & """", WINDOWVIEWSTATE_HIDE,
-1
database. The problem is, it should open it hidden, with the second argument
to the wscript run command being 0, but it doesnt do so. Any suggestions?
Here's the script:
Const FOLDERPATH = "C:\Working\Access\All County\"
Const SCHEDULERFILE = "Scheduler.mdb"
Const LDBFILE = "Scheduler.ldb"
Const WINDOWVIEWSTATE_HIDE = 0
Const ERRPERMISSIONDENIED = 70
Set FSO = Wscript.CreateObject("Scripting.FileSystemObject")
On Error Resume Next
If FSO.FileExists(FOLDERPATH & LDBFILE) Then
FSO.DeleteFile FOLDERPATH & LDBFILE
If Err.Number = ERRPERMISSIONDENIED Then
Wscript.Echo "Scheduler already running"
Wscript.Quit
End If
End If
set objShell = Wscript.CreateObject("Wscript.Shell")
objShell.Run """" & FOLDERPATH & SCHEDULERFILE & """", WINDOWVIEWSTATE_HIDE,
-1