Community forum

Please note that VisualCron support is not actively monitoring this community forum. Please use our contact page for contacting the VisualCron support directly.


stevja01
2016-09-02T02:05:37Z
I need to run a script to replace the HEADER in a TEXT file and ignore row 1 in that same TEXT file. When I double click on the .BAT file on the server it runs fine. If I try to execute it from VisualCron it only completes the first line of code below (TYPE) statement. I've tried running it in Foreground and Background, Hidden Directory, I've made sure the .BAT file is available for EVERYONE, I've made sure the folder is shared with EVERYONE. So I can't figure out why it won't execute the MORE +1 command within the script.

.BAT Script
REM** Script to ignore the existing HEADER in the extract, replace with correct HEADER and then output the new HEADER and DATA to a new TEXT file.

CD "D:\Acme\Cipher\Reports\Client Store\QC_Acme_RMS"

TYPE "D:\Acme\Cipher\Reports\Client Store\QC_Acme_RMS\QCReportHeader.txt" > "D:\Acme\Cipher\Reports\Client Store\QC_Acme_RMS\CLIENT_WEEKLY_STOREINFO_DATA_BY_ORG.TXT"

MORE +1 "D:\Acme\Cipher\Reports\Client Store\QC_Acme_RMS\QC WEEKLY STOREINFO SALES BY ORG L12W.GTM_Data.txt" >> "D:\Acme\Cipher\Reports\Client Store\QC_Acme_RMS\CLIENT_WEEKLY_STOREINFO_DATA_BY_ORG.TXT"
Sponsor
Forum information
Support
2016-09-02T12:22:53Z
First try to find out which line is causing the error by adding line by line in the script. Then it might be easier to tell why.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
stevja01
2016-09-02T16:36:05Z
Hi Henrik,
Sorry I thought I made a note of that.
When I run the .BAT script from the file path it works fine; if I try to execute it from VisualCron it only executes the TYPE command.
VisualCron v7.7.3 Build 22863

Sample Script:
TYPE header.txt > outputfile.txt
MORE +1 badinputfile.txt >> outputfile.txt
Support
2016-09-13T07:40:37Z
I believe that MORE interferes with output. You can try to uncheck "Store standard output" and "Store standard error" in the Task.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
stevja01
2016-09-13T20:09:26Z
Since we couldn't get it to work we went with a PowerShell script.
Scroll to Top