Results 1 to 4 of 4

Thread: Getting error while running batch file on a Comp connected through LAN

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2008
    Posts
    3

    Angry Getting error while running batch file on a Comp connected through LAN

    Hi,

    I am trying to access a folder located in a shared folder of another computer . I have read permissions to that folder. But once I am through with completion of my data, I want to wite that Data to that Read Folder.
    So through this code I am using some developer's login Id and password who has got Write permissions on that folder.

    I am using CreateProcessWithLogonW function for this purpose, but it is throwing return code --"0"
    Code:
    Res = CreateProcessWithLogonW(StrPtr(sUsername), StrPtr(sDomain), _
        StrPtr(spwd), LOGON_WITH_PROFILE, 0&, StrPtr(sCmd), 0&, ByVal 0&, _
        StrPtr(sDir), SInfo, PInfo)
    
    ****************************************************
    ''''In sCmd - I am passing the information to run a batch file which contains the list of parts to be copied and source and destination info.
    
    ****************************************************
    
            If Res <> 0 Then
             dwWait = WaitForInputIdle(PInfo.hProcess, INFINITE)
                 Debug.Print "user input ready..."
         ' do something when app ready for input
               Do
                    dwWait = MsgWaitForMultipleObjects(1, PInfo.hProcess, 0, INFINITE, QS_ALLINPUT)
                   DoEvents
              Loop Until dwWait = WAIT_OBJECT_0
                Debug.Print "process closed/terminated"
               ' do something when launched app terminates
               CloseHandle PInfo.hThread
               CloseHandle PInfo.hProcess
           Else
               MsgBox "CreateProcessWithLogonW() failed with error " & Err.LastDllError, vbExclamation
           End If
    And Err.LastDllError throws a return code --"1058"

    The description of this error ---> The service cannot be started, either because it is disabled or because it has no enabled devices associated with it.

    What could possibly be wrong in this code ?
    What kind of services do we need to start before execution or during execution ?

    Please help me with this problem.

    Thanks,
    G
    Last edited by Hack; Nov 7th, 2008 at 08:00 AM. Reason: Added Code Tags

Posting Permissions

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



Click Here to Expand Forum to Full Width