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"And Err.LastDllError throws a return code --"1058"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
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




Reply With Quote