|
Taken from the 4NT help file::Conditional Commands
When an internal command or external program finishes, it returns a result called the exit code. Conditional commands allow you to perform tasks based upon the previous command's exit code. Many programs return a 0 if they are successful and a non-zero value if they encounter an error.
If you separate two commands by && (AND), the second command will be executed only if the first returns an exit code of 0. For example, the following command will only erase files if the BACKUP operation succeeds:
[c:\] backup c:\ a: && del c:\*.bak;*.lst
If you separate two commands by || (OR), the second command will be executed only if the first returns a non-zero exit code. For example, if the following BACKUP operation fails, then ECHO will display a message:
[c:\] backup c:\ a: || echo Error in the backup!
All internal commands return an exit code, but not all external programs do. Conditional commands will behave unpredictably if you use them with external programs which do not return an explicit exit code. To determine whether a particular external program returns a meaningful exit code use an ECHO %? command immediately after the program is finished. If the program's documentation does not discuss exit codes you may need to experiment with a variety of conditions to see how the exit code changes. Note that this is backwards from the C/Perl meaning of && and || , because in DOS, 0 = succes but in C, 0 = failure.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
Magnae clunes mihi placent, nec possum de hac re mentiri.
|
|
|
|
|
so it is the logical OR operator. wonder why it doesn't appear anywhere in cmd.exe's help (or maybe I missed it...)
thank you!
Michael Dunn wrote: in DOS, 0 = succes but in C, 0 = failure.
which is why main() used to return 0 on success in old DOS programs...
[edit] not only in DOS but all programs. using MFC made me forget that.[/edit]
kind of confusing, isn't it...
4NT[^] looks useful. I'm looking in to that too. Thanks again!
-- modified at 19:37 Monday 26th December, 2005
|
|
|
|
|
Printing is sent from an application ( notepad,wordpard,pdf file etc) .
I want some default data to be printed with the print data.
or
start a progarm/application , when i goes for print from any application.
plz ,give me the idea...
|
|
|
|
|
|
Guru prasad sahoo wrote: I want some default data to be printed with the print data.
do you mean, like a separator page at the beginning of each print job? that can be done in the printer's settings in control panel
Guru prasad sahoo wrote: start a progarm/application , when i goes for print from any application.
I doubt the OS provides a standard setting to do this...
|
|
|
|
|
Guru prasad sahoo wrote: I want some default data to be printed with the print data.
or
start a progarm/application , when i goes for print from any application.
Hi, could you explain more detail about that? Because I don't know what you want to do with printing.
|
|
|
|
|
I have installed WS 2003 and applied sp1 from the MSDN CD. I have not activate it yet and I like to use my VLK. When I try the new key it tells me that it is an invalid key. How can I change it?
|
|
|
|
|
The problem is that you installed the service pack before activating Windows. Scrap it and reinstall Windows Server 2K3, activate it, THEN install the service pack.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I do not want to reinstall ws 2k3. Can this be done via terminal services?
|
|
|
|
|
Nope. Installing the service pack is what screwed up your chance to use the key you have.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Is it a possible method to uninstall service pack and activate windows? If it is possible then reinstall service pack 1 again
|
|
|
|
|
You can TRY it, but I don't think it'll work. Installing SP1 is akin to turning his MSDN version of Windows into hte ull retail version. I don't think it'll back that portion out.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
If he make a system restore point before he install sp1, can we restore an orginal system setting in order to activate the product?
|
|
|
|
|
Create a restore point just to save the activation???? WHY? I have no idea if it'll work so you'll have to try it yourself.
I agree that it's a good idea to create a store point before installing a service pack. In fact, it's done automatically when the SP is installed.
The whole point, though, is to activate the thing BEFORE you install the SP.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Neither is correct. Sorry.
|
|
|
|
|
I want to open a chm file from a network location. Due to a recent ms security path, you can't do it.
I was reading the following microsoft article which explains the workaround.
http://support.microsoft.com/kb/896054/
i want to use the solution listed in "Example 1: How to use UrlAllowList to enable specific URLs"
The reg file i created is:
REGEDIT4<br />
<br />
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\HTMLHelp]<br />
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\HTMLHelp\1.x\ItssRestrictions]<br />
"UrlAllowList"="\\\\beyond15\\GASPNet 7\\;file://\\\\beyond15\\GASPNet 7"<br />
It works if i access the folder via \\beyond15\GASPNet 7\ and then execute the chm, but if i create a network drive (i.e. z:\) with that folder, i can open the file but i get the message action cancelled.
any ideas?
Thank you very much
-- modified at 15:30 Wednesday 21st December, 2005
|
|
|
|
|
kfaday wrote: It works if i access the folder via \\beyond15\GASPNet 7\ and then execute the chm, but if i create a network drive (i.e. z:\) with that folder, i can open the file but i get the message action cancelled.
In my opinion, you should try to change the path in your regiedit to the specifi drive that you mapped.
|
|
|
|
|
Would you mind telling me how to do that?
Thanks
|
|
|
|
|
Try to change:
REGEDIT4<br />
<br />
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\HTMLHelp]<br />
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\HTMLHelp\1.x\ItssRestrictions]<br />
"UrlAllowList"="\\\\beyond15\\GASPNet 7\\;file://\\\\beyond15\\GASPNet 7"
to
REGEDIT4<br />
<br />
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\HTMLHelp]<br />
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\HTMLHelp\1.x\ItssRestrictions]<br />
"UrlAllowList"="\\\\beyond15\\GASPNet 7\\;file://z:\"
or
REGEDIT4<br />
<br />
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\HTMLHelp]<br />
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\HTMLHelp\1.x\ItssRestrictions]<br />
"UrlAllowList"="z:\;file://\\\\beyond15\\GASPNet 7"
or
REGEDIT4<br />
<br />
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\HTMLHelp]<br />
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\HTMLHelp\1.x\ItssRestrictions]<br />
"UrlAllowList"="z:\;file://z:\"
I can't guarantee it is working or not but you should try to do the above method first. But make sure to backup the registry key before you do that.
|
|
|
|
|
thanks for your help, but none of them worked
|
|
|
|
|
I am developing custom GINA which authenticates users based on tag reads from a USB Tag Reader(USB-Serial) that gives the tag id on COM3 as input to GINA.
I am having a few problems with the final step of getting my software to work, and I would appreciate a few comments from you on the problem that I am facing currently.
I have replaced MSGINA.DLL with a customised GINA.DLL and I have to get user information from an USB Tag Reader (USB-Serial) which provide a virtual COM port(COM3).
I am trying to read COM3 during WINLOGON by using CreateFile() and ReadFile() function but, I am getting an error that : "The Parameter is incorrect"
though I am getting the VALID HANDLE of the COM3. This is a program that works quite well in my development environment when I am logged in - but fails with this error when GINA tries to execute it during startup.
Is there any special security setting I have to set to access the COM3 before WINLOGON ? This is an issue that I am not able to find properly , and I would appreciate a few pointers to help me overcome this problem.
Please reply me as soon as possible..
--------------------------------------------------------------- This is sample source code to access Virtual COM (COM3) and mentioned where the error occured------------------------------
if (hPort == NULL)
{
hPort = CreateFile ("\\\\.\\COM3", // Pointer to the name of the port
GENERIC_READ | GENERIC_WRITE, // Access (read-write) mode
0, // Share mode
NULL, // Pointer to the security attribute
OPEN_EXISTING, // How to open the port
0, // Port attributes
NULL); // Handle to port with attribute
if (hPort == INVALID_HANDLE_VALUE)
{
printf("Could not open %s\n",port_name); // process error
}
Port_Ready = SetupComm(hPort, 34, 34); // set buffer sizes
if(!Port_Ready)
{
printf("%d\n",GetLastError());------------------------------------------------------------------------->"The Parameter is Incorrect"
return 1;
}
Port_Ready = GetCommState(hPort, &dcb);
if(!Port_Ready)
{
printf("Getting Port Comm State Fail\n");
}
dcb.BaudRate = CBR_38400;
dcb.Parity = NOPARITY;
dcb.ByteSize = 8;
dcb.StopBits = ONESTOPBIT;
dcb.fAbortOnError = TRUE;
dcb.fRtsControl=TRUE;
dcb.fParity = FALSE;
Port_Ready = SetCommState(hPort, &dcb);
if(!Port_Ready)
{
printf("%d\n",GetLastError());
return 1;
}
Port_Ready = GetCommTimeouts (hPort, &CommTimeouts);
if(Port_Ready)
{
printf("%d\n",GetLastError());
return 1;
}
CommTimeouts.ReadIntervalTimeout = 5000;
CommTimeouts.ReadTotalTimeoutConstant = 5000;
CommTimeouts.ReadTotalTimeoutMultiplier = 100;
Port_Ready = SetCommTimeouts (hPort, &CommTimeouts);
if(Port_Ready)
{
printf("%d\n",GetLastError());
retunr 1;
}
PurgeComm(hPort,PURGE_RXCLEAR);
if(!SetCommMask(hPort, EV_RXCHAR))
{
printf("%d\n",GetLastError());
return 1;
}
if(WaitCommEvent(hPort, &dwEventMask, &over))
{
if(ReadFileEx(hPort, &Buffer, PACKET_SIZE, &Bytes_Read, NULL)==FALSE)
{
printf("%d",::GetLastError());
return 1;
}
}
Atanu Biswas
|
|
|
|
|
I have run into this problem.
http://www.experts-exchange.com/Web/Browser_Issues/Q_21370470.html[^]
Anyone know how to fix it?
I have run MS AntiSpyware, toolbarcop and hijackthis. In toolbarcop I deleted two empty toolbar entries to no avail. All other entries look OK.
Unfortunately I don't want to subscribe to experts exchange, who look like they may have the answer.
This all happened when a colleague sent me a link to his family web site.
Kevin
|
|
|
|
|
Are you running Google Desktop Search? Uninstall it. It's a known bug with Google.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Not running desktop search but a bit of trial and error in Toolbarcop (http://www.winhelponline.com/tbchelp.htm[^]) identified the culprit as the Google Toolbar! First time I've had any problems with it. Anyway, disabling and then enabling the toolbar entries in Toolbarcop sorted it.
Kevin
|
|
|
|
|
That can happen if a toolbar subclasses the IE frame window, and the character sets on the two don't match (toolbar ANSI, IE Unicode), and the toolbar doesn't properly route unhandled messages back to the frame.
I used to do this in my toolbars (the bars would broadcast messages to communicate with other running instances) but I stopped doing it w/messages because of just this problem.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
Kosh reminded me of some of the prima-donna programmers I've worked with. Knew everything but when you asked them a question; never gave you a straight answer.
-- Michael P. Butler in the Lounge
|
|
|
|