0

How can i open notepad file from another computer using webservice ?

Locally the webservice is running fine and when invoke it opens the notepad file,but when the webservice is deployed in server the notepad file does not get opened.

Code :

 //Process
 [WebMethod]
 [ScriptMethod(ResponseFormat = ResponseFormat.Json)]
  public void notepadopen()
  {

   Process.Start("F:\\log.txt");
  }

Note : Also tried

Process.Start(@"\\192.168.1.8\f\log.txt");

I have already done several methods , some reference SO posts :

Need to execute *.exe in server from ASP.net

Tried setting load user profile to true enter image description here

Invoke an application using webservice

Foo.cmd won't output lines in process (on website)

Already gave permission to access the folder and file enter image description here

Also Enabled ASP impersonation enter image description here

ISAPI and CGI restriction : enter image description here

Application pool pipeline :

enter image description here

How can i open a notepad file (or any process) remotely using webservice ?

i can run above program in ASP development server , but cannot run the same when deployed in IIS

If you are unclear or have found any post related please post them.

Any help would be of great use.Thanks

Community
  • 1
  • 1
Tharif
  • 13,794
  • 9
  • 55
  • 77
  • have you tried calling notepad with the file as a parameter? Process.Start("notepad.exe F:\\log.txt"); – arieljannai Feb 10 '16 at 09:55
  • your command will show error..have a try – Tharif Feb 10 '16 at 09:56
  • 1
    Map F: drive on remote machine and give the qualified path with mapped drive name and then txt file.. – Raj Karri Feb 10 '16 at 16:10
  • no result after doing same @RajKarri – Tharif Feb 11 '16 at 05:49
  • 1
    I'm unclear on what you're trying to achieve here. If, ultimately, you succeed in running another program, it will be running *on the server* and it will not be visible/usable for any user who happens to be logged on to the server (via e.g. Remote Desktop). Is that really what you're aiming for? – Damien_The_Unbeliever Feb 12 '16 at 07:15
  • @Damien_The_Unbeliever i can run above program in ASP development server , but cannot run the same when deployed in IIS.. – Tharif Feb 12 '16 at 08:00
  • 1
    When you use the ASP development server, it's running as *you*, interactively, rather than as a service. Also, your machine is acting in both the roles of a *client* (because you're using a browser) *and* as a server (because you're running the server). That's a *very* different environment to when running under IIS. – Damien_The_Unbeliever Feb 12 '16 at 08:09
  • thank you @Damien_The_Unbeliever for your time..is there anything to try the same so that i can get the result ? – Tharif Feb 12 '16 at 08:11

0 Answers0