none
Can't start exe with process.start RRS feed

  • Question

  • About a year ago I developed an application for zipping some directories
    and files into a single file. The application referenced dotnetzip.dll
    I added this exe to another project so it could be called with process.start and
    everything seemed to work fine and I forgot about it.
    However I just realised that it no longer works from the main application.
    When I click a button to start it the UAC pops up saying do you want to run this application, click ok, then nothing.
    There is no error message, just a brief showing of the hourglass.
    So, I went back to the original exe and tried double clicking with the mouse. Again nothing.
    The only way the exe works is if I click it in the degbug or release folder. As soon as I copy it to another location it
    no longer works. I guess it needs some other files that are present in the debug or release folder.
    I don't know if I'm going mad or if I changed something or something in windows has changed.
    Anyone shed any light on this?
    Sunday, January 26, 2020 4:05 PM

All replies

  • You can use instead .NET classes like ZipArchive
    • Edited by Castorix31 Sunday, January 26, 2020 4:20 PM
    Sunday, January 26, 2020 4:19 PM
  • Hi,

    That was my original idea but I wanted a password but I don't think that supports that.

    Anyway, I found that if I copy the whole release directory then I can run it from anywhere on the computer. So I tried adding those files to the project. Still no joy.

    Is it possible to add them as resources?

    Andy

    Sunday, January 26, 2020 5:57 PM
  • Hi,

    You can try run as administrator,see the following link:

    https://stackoverflow.com/questions/16804103/run-another-program-as-administrator

    Best Regards,

    Alex


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, January 28, 2020 5:37 AM
  • I tried run as administrator, made no difference.

    So I thought I'd try adding the files to resources and see if I could find a way of running it from there somehow.
    I added restore.exe, restore.exe.manifest & dotnetzip.dll into my resources folder.

    Then without doing anything else I ran the program so I could look at the UAC prompt to see where the restore program had been copied. (I'm publishing with clickonce so it gets copied to some obfuscated folder). The UAC prompt popped up, I made a note of the filepath so I could try starting the program from there, clicked ok and bugger me restore.exe started!

    I didn't do anything else.

    I also notice that the manifest file is nowhere to be seen in the published location.

    So it seems to be accidentally fixed but I have no idea what happened or why it stopped working in the first place. 

    Tuesday, January 28, 2020 3:33 PM
  • Hi,

    I'm sorry to reply so late,You can check if your program needs any configuration files.You cannot run your program because of missing configuration files.

    Best Regards,

    Alex


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, February 14, 2020 8:18 AM