ina

New Member
Joined
May 18, 2010
Messages
4
I am making a program. I want to import XML file to schtasks.exe, I have to set the path of the program.

Here's the part of XML code :
Code:
<Exec>
      <Command>"C:\MyPath\program.exe"</Command>
      <Arguments>/copy</Arguments>
    </Exec>

In my opinion, I have to set the path as variable, so the program will set the variable as the path.

Another opinion, I just make the XML file as a resource file, but I don't know how to set the path, userid, author etc.

What do you think? I need some suggestion.
 


Solution
When importing an XML file to schtasks.exe to set up a task, you have a couple of options for handling the path to the program you want to execute: 1. Setting the Path as a Variable in the XML File: - You can define a variable in your XML file to represent the path to the program, which can be dynamic. - Here's an example of how you can modify your XML code to include a variable for the path:
Code:
xml %ProgramPath% /copy
- In this case, %ProgramPath% would be replaced with the actual path when the task is configured or triggered. 2. Using the XML File as a Resource File: - You can include the XML file as a resource file within your program. - When setting up the task using schtasks.exe, you would need...
When importing an XML file to schtasks.exe to set up a task, you have a couple of options for handling the path to the program you want to execute: 1. Setting the Path as a Variable in the XML File: - You can define a variable in your XML file to represent the path to the program, which can be dynamic. - Here's an example of how you can modify your XML code to include a variable for the path:
Code:
xml %ProgramPath% /copy
- In this case, %ProgramPath% would be replaced with the actual path when the task is configured or triggered. 2. Using the XML File as a Resource File: - You can include the XML file as a resource file within your program. - When setting up the task using schtasks.exe, you would need to reference the path to the program within your code. - This approach is useful if you want the XML file to be part of your program's resources and don't want to expose the path directly in the XML file. Regarding setting the path, user id, author, and other details in the XML file, here are some suggestions: - Setting the Path: - If you choose the variable approach, you can set the path dynamically during task creation or execution. - User ID and Author Information: - For user ID and author information, you can add custom elements in the XML file to store this metadata. - Here's an example of how you can include author information in the XML:
Code:
xml Your Name
- Similarly, you can add elements like , , or any other custom information you want to include. - Resource File: - If you decide to use the XML file as a resource, you won't need to set the path directly in the XML. Instead, the program can access the resource and set the path dynamically within the code. Ultimately, the approach you choose depends on your specific requirements and how you want to manage the path, user ID, and author details within the XML file and your program. Both methods have their advantages, so consider what works best for your application's needs.
 


Solution
Back
Top