Newbie quetion: problems with Chr(34)

  • Thread starter Thread starter Joseph Oget
  • Start date Start date
J

Joseph Oget

Hi guys,

I am very new to .NET, its my 2nd day (hey!) and I have a little problem.

When I try to run the command below "System.Diagnostics.Process.Start( strCmd & StrCleanUpScript )"

I get an error that the file cannot be found, but when I try to use Chr(34) I get another error saying that Chr is not declared.
I have to specify wscript because in my organisation, VBS file are not executable, they open in notepad.

TIA

Jospeh

Dim strPath As String = AppPath & "\"
Public Function AppPath() As String

Return System.IO.Path.GetDirectoryName(Reflection.Assembly.GetEntryAssembly().Location)

End Function


Private Sub BtnCleanUpClick(sender As System.Object, e As System.EventArgs)

Dim StrCleanUpScript As String = strPath & "vbs_FilesClean Temp Files.vbs"
Dim strCmd As String = "C:\winnt\system32\wscript.exe "
MessageBox.Show( StrCleanUpScript )
System.Diagnostics.Process.Start( strCmd & StrCleanUpScript )

End Sub
 
There is an overload for Process.Start() that takes arguments as a separate parameter. Use that one for your case.

Process.Start (strCmd, StrCleanUpStript)
Hi guys,

I am very new to .NET, its my 2nd day (hey!) and I have a little problem.

When I try to run the command below "System.Diagnostics.Process.Start( strCmd & StrCleanUpScript )"

I get an error that the file cannot be found, but when I try to use Chr(34) I get another error saying that Chr is not declared.
I have to specify wscript because in my organisation, VBS file are not executable, they open in notepad.

TIA

Jospeh

Dim strPath As String = AppPath & "\"
Public Function AppPath() As String

Return System.IO.Path.GetDirectoryName(Reflection.Assembly.GetEntryAssembly().Location)

End Function


Private Sub BtnCleanUpClick(sender As System.Object, e As System.EventArgs)

Dim StrCleanUpScript As String = strPath & "vbs_FilesClean Temp Files.vbs"
Dim strCmd As String = "C:\winnt\system32\wscript.exe "
MessageBox.Show( StrCleanUpScript )
System.Diagnostics.Process.Start( strCmd & StrCleanUpScript )

End Sub
 
Back
Top