Hello all,
I wanted to adda subrouting to an existing script and when I added the following code, I received the "argument mismatch" error
Code
' This is a template for writing a subroutine that the "Execute Script"
' action will call on the client.
'------------------------------------------------------------------------------------------------
Sub ExecutePowerUser(Pub, Act)
' Pub is a reference to the Publication.
' Act is a reference to the Action.
' To set a return value just uncomment one of the next two lines.
' Act.ReturnValue = "Some value"
' Act.ReturnValue = 0
exe = """c:\program files\Windows Media Player\MediaPlayer_CU.EXE"""
args = ""
wait = True
WriteLog("Executing "&exe)
retval = RunCommand(exe, args, wait)
WriteLog("Return value "&retval)
If ( retval <> 0 ) Then
WriteLog("Error executing "&exe&" "&args)
WriteLog("retval: "&retval)
StopServices=False
End If
Act.ReturnValue = retval
End Sub
'-----------------------------------------------------------------------------------------------------
' This sub routine removes shortcuts from the specified locations
'-----------------------------------------------------------------------------------------------------
Sub Cleanup(Pub, Act)
Dim fileSysObj
Set fileSysObj = CreateObject("Scripting.FileSystemObject")
fileSysObj.DeleteFile "c:\documents and settings\"&iMobile.user&"\desktop\Windows Media Player.lnk" ' optional second parameter "Force" which is needed to delete read only files.
'fileSysObj.DeleteFile "c:\documents and settings\"&iMobile.user&"\Application Data\Microsoft\Internet Explorer\Quick Launch\Windows Media Player.lnk"
End Sub
Any assistance is greatly appreciated...
I wanted to adda subrouting to an existing script and when I added the following code, I received the "argument mismatch" error
Code
' This is a template for writing a subroutine that the "Execute Script"
' action will call on the client.
'------------------------------------------------------------------------------------------------
Sub ExecutePowerUser(Pub, Act)
' Pub is a reference to the Publication.
' Act is a reference to the Action.
' To set a return value just uncomment one of the next two lines.
' Act.ReturnValue = "Some value"
' Act.ReturnValue = 0
exe = """c:\program files\Windows Media Player\MediaPlayer_CU.EXE"""
args = ""
wait = True
WriteLog("Executing "&exe)
retval = RunCommand(exe, args, wait)
WriteLog("Return value "&retval)
If ( retval <> 0 ) Then
WriteLog("Error executing "&exe&" "&args)
WriteLog("retval: "&retval)
StopServices=False
End If
Act.ReturnValue = retval
End Sub
'-----------------------------------------------------------------------------------------------------
' This sub routine removes shortcuts from the specified locations
'-----------------------------------------------------------------------------------------------------
Sub Cleanup(Pub, Act)
Dim fileSysObj
Set fileSysObj = CreateObject("Scripting.FileSystemObject")
fileSysObj.DeleteFile "c:\documents and settings\"&iMobile.user&"\desktop\Windows Media Player.lnk" ' optional second parameter "Force" which is needed to delete read only files.
'fileSysObj.DeleteFile "c:\documents and settings\"&iMobile.user&"\Application Data\Microsoft\Internet Explorer\Quick Launch\Windows Media Player.lnk"
End Sub
Any assistance is greatly appreciated...