VS 2008 [RESOLVED] Can't get Process.Start to work on IIS7/Server 2008 (oops it's SBS 2011!)-VBForums
Results 1 to 11 of 11

Thread: [RESOLVED] Can't get Process.Start to work on IIS7/Server 2008 (oops it's SBS 2011!)

Threaded View

  1. #1

    Thread Starter
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    CT
    Posts
    15,658

    Resolved [RESOLVED] Can't get Process.Start to work on IIS7/Server 2008 (oops it's SBS 2011!)

    [edit]actually it's SBS 2011[/edit]

    I cannot get PROCESS.START to work on a Server 2008 box - tried all kinds of credential settings - getting no where.

    I recently added the un/pw stuff - if I put a bad username it gives me an error - but with a good one nothing happens - the process never starts.

    Code:
                    Dim strFile As String = "Report_" & rptid & ".bat"
                    Dim strBatFile As String = Path.Combine(strReportFolder, strFile)
    
                    Using fileWrtr = New StreamWriter(strBatFile, False)
                        fileWrtr.WriteLine("CD /D " & strReportFolder)
                        fileWrtr.WriteLine("set path=" & strReportFolder)
                        'fileWrtr.WriteLine("amc rpt/printers")
                        fileWrtr.WriteLine(strCmd)
                        fileWrtr.Close()
                    End Using
                    Dim psusername As String = "xxxxx"
                    Dim pspassword As SecureString = ConvertToSecureString("passwordxxxx")
                    Dim psdomain As String = "somedomain"
    
                    If blnSubmit Then
                        Try
                            Process.Start(strBatFile, psusername, pspassword, psdomain)
                            .StartObject()
                            .NewObject("rptid", rptid)
                            .Seperate()
                            .NewObject("queued", IIf(blnSubmit, "N", "Y").ToString)
                            .EndObject()
                        Catch ex As Win32Exception
                            .StartObject()
                            .NewObject("%%dalerror%%", ex.Message)
                            .EndObject()
                        Catch ex As Exception
                            .StartObject()
                            .NewObject("%%dalerror%%", ex.Message)
                            .EndObject()
                        End Try
                    End If
    Last edited by szlamany; Apr 1st, 2012 at 06:49 PM.

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.