Page Index Toggle Pages: [1] 2  Send Topic Send Topic Print Print
Hot Topic (More than 10 Replies) Alternate Program in Q&A 4.0 - Win XP (Read 5871 times)
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Alternate Program in Q&A 4.0 - Win XP
Apr 7th, 2006 at 7:05am
Print Post Print Post  
Recently migrated from Windows 98 to Windows XP in order to work efficiently in Sesame.  Come to find out that one of command in batch file which activated by alternate program in the Main Menu of Q&A 4.o.

I have 3 command line to be executed in the batch file, one of them is not executing while other two do execute. If I activate the batch file from the DOS command prompt, all three commands execute like it should.

I had absolutely no problem with this in Windows 98. Other than this, migration was pretty smooth. With this problem also, since it is the last step, I can go to DOS prompt and finish up the process. However, I am totally stumped with this behavior of XP.  Any work-around or solution? Did anyone have similar experience? Please help.

Bharat Naik

  
Back to top
 
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1350
Location: New Hampshire
Joined: Mar 11th, 2003
Re: Alternate Program in Q&A 4.0 - Win XP
Reply #1 - Apr 7th, 2006 at 12:54pm
Print Post Print Post  
Shelling out of Q&A does work differently in Windows NT, 2000, & XP than it did in Windows 98.

For instance, you cannot simply place "winword.exe" in Q&A's Alternate Programs screen. You must create a batch file that contains "winword.exe", and place the name of the batch file in Q&A's Alternate Programs screen.

Since you say all 3 of your command lines work if the batch file is called from a DOS command prompt, you may have success if you create a NEW batch file that calls the original batch file, and place the new one in Q&A's Alternate Programs screen.

The new batch file would contain something like:
Code
Select All
@Echo Off
Cls
Call C:\bat\original.bat 


The first two lines are optional.

If that does not work, post the contents of the original batch file here.
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: Alternate Program in Q&A 4.0 - Win XP
Reply #2 - Apr 7th, 2006 at 2:18pm
Print Post Print Post  
Hi Carl,
Thanks for responding. Unfortunately calling batch file from a batch file did not do the trick. Also tried with putting the folders in Path Commands (environment variable), that did not help. Contacted the developer of the utility but he did not come up with any solution so far.

This is a command line utility which I use to put Carriage Return at position 321 in the line and remove blank lines from the text file. The command line utility name is xchangecl

Here is my result with the utility:

=====================
This is test.bat file

@echo
xchangecl -t# c:\qa\write\bharat.txt /#13##10##13##10#/#13##10#/
pause

==============================================================
C:\QA>test
ECHO is on.

C:\QA>xchangecl -t# c:\qa\write\bharat.txt /#13##10##13##10#/#13##10#/
Processing c:\qa\write\BHARAT.TXT

C:\QA>pause
Press any key to continue . . .

==============================================================
This is when I run the same batch file from a program

ECHO is on

C:\QA>xchangecl -t# c:\qa\write\bharat.txt /#13##10##13##10#/#13##10#/
Bad command or file name

C:\QA>pause
Press any key to continue . . .

============================================================

XchangeCL utility is available to try at
http://www.sadmansoftware.com/xchangecl/index.html

Thank you very much once again to help and looking into this. 

  
Back to top
 
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Alternate Program in Q&A 4.0 - Win XP
Reply #3 - Apr 7th, 2006 at 2:52pm
Print Post Print Post  
Bharat,

Have you tried specifying the full path to xchangecl? The error you are getting back seems to indicate the command interpreter cannot find the executable.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: Alternate Program in Q&A 4.0 - Win XP
Reply #4 - Apr 7th, 2006 at 3:08pm
Print Post Print Post  
Yes, I tried that. Nothing seems to be working. It is not too bad considering, I can put the command of the batch file at DOS command prompt and it works fine. Since it is the last step in the chain of multiple tasks, it is one manual step in otherwise completely automatic process. However, it bothers me to see, how come it is not working in Windows XP.

Thanks Mark.
  
Back to top
 
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1350
Location: New Hampshire
Joined: Mar 11th, 2003
Re: Alternate Program in Q&A 4.0 - Win XP
Reply #5 - Apr 7th, 2006 at 3:28pm
Print Post Print Post  
My initial thought is what Mark already posted.

I've never experimented with this, but have you tried setting Compatibility Mode in the Q&A shortcut?

Other than that, I don't know either.
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Alternate Program in Q&A 4.0 - Win XP
Reply #6 - Apr 7th, 2006 at 3:36pm
Print Post Print Post  
It is probably failing (just guessing here) because 98 and it brethren run a command interpreter called "command.com", while XP and its brethren run a command interpreter called "cmd.exe". Command.com is the original DOS command interpreter, but cmd.exe is a new program introduced with Windows NT. Most XP systems do come with both and you may be able to force your application to use command.com instead of cmd.exe.

Is the directory where xchangecl resides in your PATH environment variable?
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: Alternate Program in Q&A 4.0 - Win XP
Reply #7 - Apr 7th, 2006 at 3:37pm
Print Post Print Post  
Carl,
Yes, I tried Compatibility mode Windows 95 and Windows 98 also with the same results. I guess, it is the Utility problem, since the other two commands in that batch file works fine.
Thanks.
  
Back to top
 
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Alternate Program in Q&A 4.0 - Win XP
Reply #8 - Apr 7th, 2006 at 3:40pm
Print Post Print Post  
It appears to be very similar to the utility called "sed" (stream editor). I believe there are versions of sed available for windows.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: Alternate Program in Q&A 4.0 - Win XP
Reply #9 - Apr 7th, 2006 at 3:53pm
Print Post Print Post  
XChancgCL is designed to only work on true text files. 

Your files are in ..\QAWRITE\ folder which suggests the files are created with QAWRITE.  This may be causing part of the problem.  Have they been saves as text files, or just have a *.txt extebsion?  IS there any header information on the files that would indicate they are not true text files?

Have you tried using "test" files created with wordpad or notepad vs. qawrite?

Yes, I am ignoring the change between Operating Systems and DOS windows vs. batch files.  But those areas have been explored, so I am trying to consider other possible causes.

---------------------------------
Another thought...
It looks like you are trying to replace 2 CRLF codes with a single one.  I have not tried this yet, but is it possible that you are missing a "/" character near the end?

C:\QA>xchangecl -t# c:\qa\write\bharat.txt /#13##10##13##10#//#13##10#/

Oops, never mind, wrong syntax.  But if you are trying to make it all one line, then this may be more correct?
C:\QA>xchangecl -t# c:\qa\write\bharat.txt /#13##10##13##10#// 
I think this syntax will remove all double CRLF codes and replace with null.

If you need to replace characters in position 321, how about using a RegEx utility insteac of XCL? 

Actually you could do that with Sesame functions.  Here is untested code:
Code
Select All
var  RemovePosition as Int
var  vNewString as String

vRemovePosition=321			/Could be a user prompt

vNewString = @Left(OldString,vRemovePosition-1) + @MidStr(OldString,vRemovePosition+1, @Len(OldString)) 

  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: Alternate Program in Q&A 4.0 - Win XP
Reply #10 - Apr 7th, 2006 at 5:32pm
Print Post Print Post  
Quote:
Your files are in ..\QAWRITE\ folder which suggests the files are created with QAWRITE.  This may be causing part of the problem.  Have they been saves as text files, or just have a *.txt extebsion?  IS there any header information on the files that would indicate they are not true text files?


This is true text file even though it is prepared using Q&A Write, it prints to disk and write a text file.

The xchangCL command works fine when it is exectuted putting batch file command at DOS command prompt but does not work when it comes out of Q&A  alternate program on the Main Menu.

Quote:
Another thought...
It looks like you are trying to replace 2 CRLF codes with a single one.  I have not tried this yet, but is it possible that you are missing a "/" character near the end?

C:\QA>xchangecl -t# c:\qa\write\bharat.txt /#13##10##13##10#//#13##10#/

Oops, never mind, wrong syntax.  But if you are trying to make it all one line, then this may be more correct?
C:\QA>xchangecl -t# c:\qa\write\bharat.txt /#13##10##13##10#// 
I think this syntax will remove all double CRLF codes and replace with null.

If you need to replace characters in position 321, how about using a RegEx utility insteac of XCL? 


I believe the command is fine as it execute well when .bat file command is given from DOS prompt.

I can probably accomplish that using Sesame but how to incorporate that in the seamless process to make everything automatic. What the program does now, are in several steps - it mass-update the file, prepare and write files in several batches in several different files, then combine those files. The file needs to have Carriage return on every line at position 321 even if it is preceded by hundreds of empty spaces, so it takes care of that, then it removes all the empty lines, then it zip the file. After zipping the file, it opens up the communication program, executes the script to pass through the password procedure of the bulletin board, when it is asked to give the name of the file to be uploaded, it gives the name of the file and then dump the file. It then asks for even file ready with the report to be downloaded and then downloads and display them one by one.  All these done with a click of one button with incorprating the outside programs using batch command. The XchangeCL program is used only to place Carriage Return on 321 position of every line and remove empty lines in the file.

Thanks Bob to look into this.

Bharat


  
Back to top
 
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: Alternate Program in Q&A 4.0 - Win XP
Reply #11 - Apr 7th, 2006 at 5:55pm
Print Post Print Post  
Quote:
Most XP systems do come with both and you may be able to force your application to use command.com instead of cmd.exe.

Is the directory where xchangecl resides in your PATH environment variable?


Yes, I have tried with putting Folder where xchangeCL resides, in the Path environment Variable but that did not change the outcome.

How to make XP system to use Command.com as opposed to cmd.exe?

  
Back to top
 
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1350
Location: New Hampshire
Joined: Mar 11th, 2003
Re: Alternate Program in Q&A 4.0 - Win XP
Reply #12 - Apr 7th, 2006 at 6:06pm
Print Post Print Post  
Quote:
It is probably failing (just guessing here) because 98 and it brethren run a command interpreter called "command.com", while XP and its brethren run a command interpreter called "cmd.exe". Command.com is the original DOS command interpreter, but cmd.exe is a new program introduced with Windows NT. Most XP systems do come with both and you may be able to force your application to use command.com instead of cmd.exe.

Mark may be onto something here. I also had noticed that there was a name change from Command to CMD at some point.

Try adding "Command /C" in the batch file that Q&A calls, like this:
Code
Select All
@echo
Command /C xchangecl -t# c:\qa\write\bharat.txt /#13##10##13##10#/#13##10#/
pause 


"Command" starts a new instance of DOS. The "/C" switch tells Command to carry out the command that appears after it.

Hmmm...
I just noticed that Q&A does seem to be using Command by default (vs CMD). You might also try changing the "Command /C" above to "CMD /C", and see if there is any difference in how they respond.
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: Alternate Program in Q&A 4.0 - Win XP
Reply #13 - Apr 7th, 2006 at 6:38pm
Print Post Print Post  
Carl,
Thank you, Thank You, Thank you. My preliminery test suggest that putting "cmd /c" in the batch file in front of questionable command execution did it. I would have never thought of anything like that myself. Even the developer of the command line utility does not have a clue. You guys are great.

Once again Thanks.

Bharat
  
Back to top
 
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1350
Location: New Hampshire
Joined: Mar 11th, 2003
Re: Alternate Program in Q&A 4.0 - Win XP
Reply #14 - Apr 7th, 2006 at 6:55pm
Print Post Print Post  
That's great to hear!
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
Page Index Toggle Pages: [1] 2 
Send Topic Send Topic Print Print