At run time, detect how program has Ran (upon request against user)

Hello

I am writing a LabWindows program that backs up data. I'll add this to my scheduled Windows tasks, but I also want that it is able to detect if someone is trying to manually run it and open an "administration panel".

Yes, is there a way direct to detect how the file was run, whether on demand or run manually?

Or y at - it a way to feed my program a '1' for him asking if it was run by a batch file and if it detects not only '1' then he opens the administration panel? I assume that if he is not the direct route, I would create a scheduled task that runs a batch file, put a '1' in a text file, and then runs the program. Then the program automatically checks in the race so that '1' is there...? After the program is run, the '1' is deleted again.

Thanks in advance!

Turbo

Turbo:

One way to do would be to use a command line parameter.

When you configure the scheduled task, pass a command line parameter, for example / Quiet, to notify your program to run without the administration panel.  You can add a parameter of the command line simply by going to the list of scheduled task, right click on your task, selecting Properties and adding the parameter of the command line after the name of the exe file (separated by a space).  When a user executes it interactively, for example from a shortcut on the desktop or in the start menu, they don't use the command line parameter so the program does not work in silent mode.

Read the command line like this:

#include
#include
int main (int argc, char * argv [])
{
int i;
int quiet = 0;
for (i = 1; i
print the parameters only if/quiet is not passed
If (stricmp (argv [i] "/ Quiet") == 0)
quiet = 1;
  
If (! quiet)
{
printf ("number of command line parameters: %d\n", argc);
printf("Parameters:\n");
for (i = 0; i
printf ("%s\n", argv [i]);
printf ("Press any key to continue...\n");
GetKey();
}
return 0;
}

The disadvantage of this method is that if they are running the program in the list of scheduled task, it will run in silent mode.

Another thing you could try is to use schtasks.exe, which comes with Windows XP, for a list of scheduled tasks, is your task in the list, check what time it is planned to execute, display time and assume that the task runs as scheduled and not manually, if present is in a short time of the scheduled time.

Use the system() function to run schtasks.exe, save the output in a file, and then open the file and read it.

System ("cmd.exe /c schtasks.exe/query /fo list > c:\\temp\\tasklist.txt");

Using the format option of list for a schtasks query, you would look first for the TaskName, then for the next run time.

To see the command line options for querying tasks scheduled by using schtasks.exe, type the following command line:

schtasks/query /?

Tags: NI Software

Similar Questions

  • Whenever I try to open Outlook Express, I get this message: Run Time Error! Program: C\Program

    original title: cannot open outlook express

    I am running windows XP Professional

    Whenever I try to open outlook express, I get this message

    Run Time Error!  Program: C\Program...

    This application has requested the execution in an unusual way.

    Please contact the support team of applications for mor information

    I can not access my emails at all.

    Search for antivirus interference.  See www.oehelp.com/OETips.aspx#3

    If you can, open OE and click file | Identities and establish a new identity.  Then see if it works.  If you can not open OE to do this, then move all the dbx files to another directory of their current location.  To reset the message store, which you should be able to open OE then.

    Steve

  • Run Time Error! Program: C\Program File\Intuit\QucikBooks\qbw2.exe.

    I get has: Run Time Error! Program: C\Program File\Intuit\QucikBooks\qbw2.exe. According to me, there is an error of NTVDM.exe code associated with it. Basically, Quick Books will not launch.

    Technicians of quick books it's a poblem Ms.

    Help

    Hello ggkline,

    I suggest you have a look on the underside of Quickbook Forum discussions:

    http://support.QuickBooks.Intuit.com/support/pages/KnowledgeBaseArticle/1004014

    http://support.QuickBooks.Intuit.com/support/pages/KnowledgeBaseArticle/1004014

    He suggests that you install the security update:

    http://support.QuickBooks.Intuit.com/support/qbupdate2007/default.aspx

    Thank you
    Irfan H, Engineer Support Microsoft Answers. Visit our Microsoft answers feedback Forum and let us know what you think.

  • A run-time-error, how to fix

    "I write a function to return a pointer of type float64 and assign the pointer to my defined Pionter 'newdata' in my StartCallBack, there is no error, but when I USE"

    DAQmxWriteAnalogF64 (gtaskhandle0, leng [0])<=leng[1]?2*leng[0]:2*leng[1], 0,="" 10.0,="" daqmx_val_groupbyscannumber,="" newdata,="" &written,="">

    I receive a run-time-error like this: "work.c", line 231, col 121, id thread 0x00007FB4: Array too small argument (40000000 bytes).  Argument must contain at least 80000000 bytes (10000000 items). Why does this happen?

    My part code:

    DAQmxCreateTask ("", & gtaskhandle0 ");
    DAQmxCreateAOVoltageChan (gtaskhandle0, ' Dev1 / ao0:1 ', ' ',-10,0, 10.0, DAQmx_Val_Volts, "");
    DAQmxSetTimingAttribute (gtaskhandle0, DAQmx_SampClk_Rate, 1000/looptime);
    DAQmxCfgSampClkTiming(gtaskhandle0,"",1000/looptime,DAQmx_Val_Rising,DAQmx_Val_FiniteSamps,leng[0]+leng[1]);
    DAQmxRegisterDoneEvent(gtaskhandle0,0,DoneCallback,);
    DAQmxWriteAnalogF64 (gtaskhandle0, leng [0])<=leng[1]?2*leng[0]:2*leng[1], 0,="" 10.0,="" daqmx_val_groupbychannel,="" newdata,="" &written,="">
    SetCtrlAttribute (panelHandle, PANEL_REALWRITE, ATTR_CTRL_VAL, (double) written);
    DAQmxStartTask (gtaskhandle0);

    From the code, we cannot see how many samples do you expect to write but there are two aspects to consider.

    DAQmxWriteAnalogF64 expects to receive the number of samples per channel to write; in other words, your "2 *" in the function call is probably wrong. See here for the function. This can cause the error you receive, because the length of the array does not match the settings (you probably want to write 5 million samples per channel).

    Second aspect, it seems to me that your function is the production of the final table with samples interleaved (i.e. array1 [0], array2 [0], array array1 [1], array2 [1]... [n-1] array1, array2 [n-1]). If this is true, you must pass the DAQmx_Val_GroupByScanNumber in the function call.

  • Run-time error. Program:... Panda Antivirus Pro 2010\TPSrv.exe__ Security\Panda

    This application has requested the execution... blah blah blah

    http://support.pandasecurity.com/forum/viewtopic.php?f=41&t=2882&SID=aa71f51ef895456c5bad165dd64dca50

    Ein Blick werfen und for fix paper :)
  • QML no compilation errors, but a run-time error, how to debug?

    Code QML without compiling error, but not show debug in C++ code show that qml-> hasErrors() took, but the I don't know what error cause of line. any ideas? I am looking for debug QML, but it seems only break in javascript, don't create not procedure.

    Momentics you need to open a "QNX Outlook Information System" [window-> open point of view]

    Right-click on the target and select "start SSH session".

    In this SSH session, after logging in, type ' slog2info w | grep ' 9000' '

    Look for a message on the QML problem.

  • You will have to give the value of the filter at run time condition.

    Hi experts

    I have a requirement in which I need to give the value of the filter at run time, for example Project_code = "XYZ"
    The XYZ value should be given at run time. How can achieve us?

    Thanks and greetings
    Frank

    Hi Jos,

    1. create a PROJECT_CODE to say as alphanumeric variable, as non-persistent data type and use it as a filter in your mapping.

    2 drag and drop the variable twice in your package make that as a declared variable and in the second stage that do like Variable refresh then in step 3 of your interface.

    3 generate a script and executing that give scenario the value you desired, press enter once you have given, otherwise it will not fetch the entry and make sure that the LAST VALUE is DISABLED.

    This way you can give values to the varaible running.

    Thank you
    Guru

  • Set the name of server report dynamically at run time

    Hi guru,.

    I called reports of the forms that I hardcode the name of report server in my code.
    Is there no alternative to set the server name of report dynamically at run time, is how to find the name of the report server and that in through my code as a parameter.


    can you give some examples of codes... Thank you

    One way that we usually followed before was to store the name of the report server in other tables in the database, then choose this name whenever we want to run a report.

    In this way, it is easy even if there is no change in the name of the server.

  • has ran sfc/scannow __message: req for Win to run successfully the files must be copied into the DLL cache. Insert the win xp pro sp3 cd. I do not have a CD. How to fix?

    Having problems starting and IE7 display problems (missing buttons on web pages or text overlay and cannot respond to the answers in this forum. AE)  has ran scannow and received the message in my question.  How can I fix?

    If you are interested, you can see my other problems that I posted another question about 'black screen at startup... '. »

    Windows xp media center SP3

    Gateway FX400XL

    NVIDIA Geforce display

    IE7

    It is unlikely for sfc/scannow to run slowly unless the Service Pack to your real XP bootable installation CD matches the Service Pack installed on the computer.  This usually isn't the way things are in the real world.

    You have a true bootable XP installation CD (it is not the same as any recovery CD provided with your system)?

    Sfc/scannow will not help running.  You can not worry it run in the future.

    Let's see what you have right now.

    Please provide additional information on your system:

    Click Start, run and enter in the box:

    Msinfo32

    Click on OK and when the system info summary appears, click on Edition, select all, copy, and then paste the information here.

    For information about video drivers, expand components, click view, click on edit, select all, copy and then paste the information here.

    There will be some personal information (such as the user name and the name of the system), and anything that turns information private for you, simply delete the pasted information.

    This will minimize back Q & A and eliminate guesswork.

    It seems that the video drivers were considered suspects and since you have NVIDIA, I let NVIDIA look at your system and see what their online scanner has to say about your system.

    I use the NVIDIA site and let scan them online take a look at your video system and see what he suggests for drivers and consider their analysis if they offer a new driver.

    It is recommended to run the scan NVIDIA with Internet Explorer.

    Here is the address of the NVIDIA page:

    http://www.nvidia.com/download/Prescan.aspx?lang=en-us

    Read the instructions, and then click the DRIVERS GRAPHICS button to start scan and see what they have to say about your graphics card and if you need to update your video drivers.

    If you have an NVIDIA card installed, you might think to replace it too (later).

    You can also consider ditching Norton - at least for now...  Maybe just uninstall Norton temporarily using their special uninstall program and get your system stabilized and then when things are stable, reinstall your Norton again if you are forced to keep.   If you have installed Norton 'out of the box' it really installs a bunch of stuff that can thwart the troubleshooting.  You can save time by simplifying your configuration by getting rid of Norton and do it out of the picture entirely until things settle down.

    Let's see what that your msinfo32 and NVIDIA has to say first.

    Do, or do not. There is no test.

    I decided to implement the points for a new puppy instead of a pony!

  • How can I set the time axis on my waveform table to show run time that is to say whenever I start the program I should have 0 as the starting point

    How can I set the time axis on my waveform table to show run time that is to say whenever I start the program I should have 0 as the starting point. I've been messing around with the without success. I'm under Labview 2012.

    Thank you!

    Townes wrote:

    I can't understand what you mean. I have no formal training with labview. It took me a long time to write the simple program that I joined. Any guidance would be greatly appreciated!

    Its pretty normal for a beginner to take the time to write code. Right-click the map of waveform > Create > property node > historical data, you will get a property node, keep this at the beginning of the code and create a constant. You can also go to the VI properties and > run and select "clear indicators when it is called.

    I recommend you to go through the basic materials of LabVIEW which will give you an understanding on the basics of bases/components of LabVIEW.

  • I can not run dinner dash hometown hero. He will be in charge, but will not play. He said that the program has stopped working. How can I fix?

    I can not run dinner dash hometown hero. He will be in charge, but will not play. He said that the program has stopped working. How can I fix?

    Hello

    Please contact the Microsoft Community and sharing this information with us.

    I'd like you try to perform a system restore to undo changes.

    See the article-

     

    http://Windows.Microsoft.com/en-us/Windows7/products/features/system-restore

    http://Windows.Microsoft.com/en-us/Windows7/restore-system-files-and-settings

    Note:

    Perform a system restore will cancel all changes made on the computer before the show. You may also lose unsaved information as well. Proceed at your own risk.

    If this is not enough, then you must contact game support for assistance.

    Do not hesitate to contact us for any problem related to Windows. We will be happy to help you.

  • How to fix Microsoft Visual C++ run time library program C:/Program File (X 8... is being done in an unusual way

    I went to Microsoft for help but was told that since the introduction of Windows 7 installed on my HP computer that HP would be difficult.  Went to HP Live Chat Support talked to three technicians different and none of them could solve the problem.  The problem is an error message that I receive as follows:
    Microsoft Visual C++ run time library program C:/Program File (X 8... ended in an unusual way - contact the programs manufacturer.)
    I did and no one wants to help.  WHY?

    Hello

    1. when exactly you receive this error message?

    2. you receive this error message when you use Internet Explorer?

    3. What is the exact full error message?

    4. have you made changes on the computer before this problem?

    Follow the mentioned below as follows:

    Step 1: Check in safe mode.

     

     

    You can also check if the problem persists in safe mode.

    Reference:

    http://Windows.Microsoft.com/en-us/Windows7/start-your-computer-in-safe-mode

    http://Windows.Microsoft.com/en-us/Windows7/advanced-startup-options-including-safe-mode

    Now step 2.

    Step 2: Perform the clean boot and check.

     

    To help resolve the error message, you can start Windows Vista or Windows 7 by using a minimal set of drivers and startup programs. This type of boot is known as a "clean boot". A clean boot helps eliminate software conflicts.

    How to troubleshoot a problem by performing a clean boot in Windows Vista or in Windows 7

    http://support.Microsoft.com/kb/929135


    Note:  After troubleshooting, be sure to start your computer in normal mode by following step 7.

    Hope the above information is helpful.

  • Every time I start Firefox, I get a survey with a suffex program has. How to eliminate

    Every time I start Firefox, I get a survey with a suffex program has. How to eliminate

    You can check the setting of the home page.

    Firefox supports several home pages separated by ' |' symbol (pipe).

    You can check for problems with the sessionstore.js file in the profiles folder that stores the session data. When sessionstore.js is deleted you lose pinned tabs and open tabs, and you need to recreate them, so possibly make a note or bookmarks.

    You can use this button to go to the current Firefox profile folder:

  • "'Monitor' program has been found running on your system -"

    A "monitor" program has been found running on your system - please unload from memory "Please can someone explain how to do this." I am running Windows Vista Home Premium + SP2. Thank you.  "Silverfox".

    The above message appears several times on my screen - what is it and how I unload it (sorry if assigned to the subject not listed)

    Silverfox salvation,

    Welcome to the Microsoft community.

    Leave your post, it seems that you have found an error, a "monitor" program has been found running on your system - please unload the memory on your computer screen.

    Quick questions:

    1. When exactly the error? Is - this random?
    2. Have you made changes on the computer before this problem?

    You can try the following hotfixes and check if that helps get rid of the pop up.

    Method 1:

    Step 1:

    Start the computer in safe mode and check the number.

    Some options, including the mode safe mode, start Windows in a limited State, where only the essential is started. If a problem doesn't reappear when you start in safe mode, you can eliminate the default settings and basic device drivers and services as a possible cause.

    Follow this link provided below to start your computer in safe mode.

    http://Windows.Microsoft.com/en-us/Windows-Vista/advanced-startup-options-including-safe-mode

    Step 2:

    Put the computer to boot and check if the problem persists.

    To help resolve the error and other messages, you can start Windows 7 by using a minimal set of drivers and startup programs. This type of boot is known as a "clean boot". A clean boot helps eliminate software conflicts.

    How to troubleshoot a problem by performing a clean boot in Windows Vista or in Windows 7
    http://support.Microsoft.com/kb/929135

    Note: After troubleshooting, be sure to set the computer to start as usual as mentioned in step 3 of the KB article provided above.

    Method 2: I also suggest that you scan your computer with the Microsoft Security Scanner, which would help us to get rid of viruses, spyware and other malicious software.

    The Microsoft Security Scanner is a downloadable security tool for free which allows analysis at the application and helps remove viruses, spyware and other malware. It works with your current antivirus software.

    http://www.Microsoft.com/security/scanner/en-us/default.aspx

    Note: The Microsoft Safety Scanner ends 10 days after being downloaded. To restart a scan with the latest definitions of anti-malware, download and run the Microsoft Safety Scanner again.

    Important: During the scan of the hard drive if bad sectors are found, the scanner tries to repair this sector, all available on which data may be lost.

    It will be useful.

    Get back with the result of the steps suggested also if you need help on Windows let us know and we will be happy to help you.

  • How can I add a page control tab at run time?

    Hello

    I'm trying to add pages in the control tab in run mode, but I can't because it must be in edit mode.

    Here are the steps that I have:

    1. run the application.

    a. the application reads a txt file and it translated into a table with the number of rooms; [201, 202, 203, 204]

    b. the application takes this array and puts in place of the pages after how it is in the table and names must be the same as the numbers. (Now the program will start to collect information to fill the pages.

    c. the user can now change between pages. (Each page will have a table that will be updated with new information at run time)

    Is this possible or have you another solution?

    Grateful for answers.

    No, you cannot add pages, just as it is not really supported to add commands or the lights either (well, unless you plan to have always installed LabVIEW and not only the execution engine. If this is the case you can self-generate tabs etc. with VI Scripting pages).

    You can use an image control to "simulate" additional tabs, the orders or the lights, but normally it is possible to find a different and easier solution.

    In your case, it seems that all the pages have the same controls on them, it would be just the content that would change. So what you really want is a way to navigate between the 'rooms' availability You could add a list next to the tab control box, fill the list box with the availability of the rooms and the value of the list box to select the content to display on the tab of single page beside him, or you can use a menu drop-down. If you do not like these alternative presentations of the room options then you can generate the tabs in an image control and have a tab control page below which showed the content of the tab selected in the image control. That's a lot of work.

    Another option would be to create Let's say 10 pages in edit mode and then have the arrows under the control that allowed the user to navigate through the available rooms in groups of 10 (still is not really necessary to individual indicators on each page you don't need to make them on page... something to get this must simply move the indicators and controls on the tab control with the) arrow keys Cela will give you a black frame behind them, but in run mode, it will look as if they are on each page). In this way, you could have the appearance tab and navigation without having to simulate the tabs with an image control. The fact that many other graphical interfaces have such navigation of two levels means that the user will still find intuitive to use.

Maybe you are looking for