• 0

[C#] Process with delay


Question

In my code, I want to start a .exe file but I want to wait 30 seconds before the start of it.

I thought of doing it like so:

ProcessStartInfo startinfo = new ProcessStartInfo();

startinfo.FileName = "cmd.exe";

startinfo.Arguments = @"C:\program.exe";

startinfo.UseShellExecute = false;

startinfo.CreateNoWindow = true;

Process process;

process = Process.Start(startinfo);

This would work except I still need a delay. Any help? Thanks.

Link to comment
https://www.neowin.net/forum/topic/464492-c-process-with-delay/
Share on other sites

5 answers to this question

Recommended Posts

  • 0

I need to clarify more. Thread.Sleep would work, except I have to make the call to start the program, and then my program has to die and be shutdown before this other process starts. I figure 30 seconds is enough time for it to do that. Is there a way to send a delay command in to the command prompt and then start my program?

  • 0

The only way I can think of doing that would be to write a second program that waits 30 seconds and loads the desired program, you call that program and close the first program, the second waits 30 seconds then loads the one you wanted to in the first place.

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • Here are all the new features Microsoft added to Teams in June 2025 by Usama Jawad Microsoft Teams is one of the most used software when it comes to online communication and collaboration, especially in enterprise environments. Even though there are still many features that people want in Teams, Microsoft tries to appease as many as it can with regular updates to the tool. Now, the Redmond tech firm has published a roundup of all the capabilities it added to Teams during the month of June 2025. Starting off with chat and collaboration improvements, we have an enhanced spellchecker offering support in up to three languages, with users being given the ability to add corrections to their personal dictionary too. In addition, the new chat and channels experience is now rolling out to Government Community Cloud (GCC) customers. Next, we have improvements to the meetings, webinars, and town halls experience. Loop-powered meeting notes are now available for GCC-High and Department of Defense (DoD) customers, and non-Teams users have the ability to join town hall meetings through Cloud Video Interoperability (CVI) join codes. It is also possible for those invited to join town halls and and webinars using sign-in details, such as PSTN. In a similar vein, town hall organizers can select individuals to manage the screen that is being shown to attendees. Organizers have more control over the broadcast of notifications too, and can also pull in a participant into the call directly and have them present their screen seamlessly. Lastly, town hall usage reports are now available in Teams Admin Center for additional insights. For those more interested on the hardware side of things, the following devices are now Teams-certified: Yealink MeetingBoard Pro MTRA Series-65, 75, and 86 inch Logitech 4K Pro Webcam (for consumer) Logitech Brio Ultra HD Pro Business Webcam (for business) Yealink RoomPanel E2 (8-inch) and E2 Plus (10 inch) Logitech Rally Board 65 + Tap IP for Teams Rooms on Android (wireless) Crestron Videobar 70 EPOS ADAPT 660 USB-C PolyStudio V12 Logitech Zone 305 (with native Bluetooth) That's not all, though. There are several other enhancements present across frontline worker solutions, security, and Teams Phone and Rooms. Read about them in detail here.
    • not if the other person can see the nickname you are setting ?
    • Sure, buddy, sure... let's compare the contents of the article to the stupid thumbnail, it's clearly the same thing and it has the same importance, of course.
    • ha..... man we must buy the wrong stuff because every one we've had has had a crease visible at work
    • I mean my expectations right now are near zero so how much lower?
  • Recent Achievements

    • Week One Done
      dennis Nebeker earned a badge
      Week One Done
    • One Year In
      timothytoots earned a badge
      One Year In
    • One Month Later
      CHUNWEI earned a badge
      One Month Later
    • Week One Done
      TIGOSS earned a badge
      Week One Done
    • First Post
      henryj earned a badge
      First Post
  • Popular Contributors

    1. 1
      +primortal
      466
    2. 2
      +FloatingFatMan
      194
    3. 3
      ATLien_0
      163
    4. 4
      Xenon
      78
    5. 5
      Som
      73
  • Tell a friend

    Love Neowin? Tell a friend!