Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9064859
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T16:21:41+00:00 2026-06-16T16:21:41+00:00

I have created a Windows Service using C# which performs variance network maintenance tasks

  • 0

I have created a Windows Service using C# which performs variance network maintenance tasks for me. One of the tasks is defraging machines remotely and for some of my older boxes I found the only way to do this was using psexec with defrag.exe. The code works fine when I simply run my C# code, however when I covert it into a Windows Service it does the defraging using the Win32_Volume table fine but it seems to get hung up when attempting to use PsExec to defrag the XP machines.

I guess my questions is, are there any known errors with using PsExec within a Windows Service? If so are there any suggestions for a different method I can use?

Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T16:21:42+00:00Added an answer on June 16, 2026 at 4:21 pm

    psexec issues a software licence agreement dialog the first time it is run as a given user, so that could be your problem if the service is running as some other user.

    You can suppress this by adding the parameter

    /accepteula
    

    This could be your problem, though obviously I can’t be sure!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a .NET Windows Service which performs certain actions and generates reports.
I have created an installation package using Wix which installs a Windows service on
I have two windows application, one is a windows service which create EventWaitHandle and
I have created an OData/WCF service using Visual Studio 2010 on Windows XP SP3
I want to start a windows service which I have created from another windows
I have a created a C# windows service (Serv.exe) which is responsible for performing
I have created a C# web service using visual studio to stop the windows
I created a Windows NT service, which exports a COM interface using ATL (out-of-proc
I have successfully created a Python Windows service using pywin32. In testing my application
I have created a windows service which gets soem info from database and I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.