elwayisgod
asked on
VBS Modification Needed
OK. When I launch the 'splice_years.vbs' form the command prompt in the 'scripts' direcotry, I get the below error. I had to copy the 'actfisc.txt' file into the 'scripts' directory from the 'data' directory. It processed the 'actfisc.txt' file ok, but when it tried the next file it errored out. Why can't it look in the 'data' directory for the data files and process them there while the script remains in the 'script' directory?
D:\AppFiles\SDS\SDS_Retail _R3\Script s>cscript splice_years.vbs
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.
start - 1/7/2013 11:25:52 AM
file actfisc.txt - 1/7/2013 11:25:52 AM
D:\AppFiles\SDS\SDS_Retail _R3\Script s\splice_y ears.vbs(2 6, 2) Microsoft VBScript
runtime error: File not found
D:\AppFiles\SDS\SDS_Retail _R3\Script s>cscript splice_years.vbs
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.
start - 1/7/2013 11:26:31 AM
file actfisc.txt - 1/7/2013 11:26:31 AM
file actppln.txt - 1/7/2013 11:26:55 AM
D:\AppFiles\SDS\SDS_Retail _R3\Script s\splice_y ears.vbs(2 6, 2) Microsoft VBScript
runtime error: File not found
splice-years.vbs
D:\AppFiles\SDS\SDS_Retail
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.
start - 1/7/2013 11:25:52 AM
file actfisc.txt - 1/7/2013 11:25:52 AM
D:\AppFiles\SDS\SDS_Retail
runtime error: File not found
D:\AppFiles\SDS\SDS_Retail
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.
start - 1/7/2013 11:26:31 AM
file actfisc.txt - 1/7/2013 11:26:31 AM
file actppln.txt - 1/7/2013 11:26:55 AM
D:\AppFiles\SDS\SDS_Retail
runtime error: File not found
splice-years.vbs
ASKER
My first two lines of the 'splice_years.vbs' is:
Option Explicit
Const C_DATA_DIR = ".\" ' "D:\AppFiles\SDS\SDS_Retai l_R3\Data\ "
Option Explicit
Const C_DATA_DIR = ".\" ' "D:\AppFiles\SDS\SDS_Retai
ASKER
OK. I'm an idiot as I forgot about trigger file. So it's executing now. However it's still requiring my data files to be in the 'scripts' directory not the 'data' directory. The second line of the 'splice_years.vbs' is: Const C_DATA_DIR = ".\" ' "D:\AppFiles\SDS\SDS_Retai l_R3\Data\ "
thus very confused here.....
thus very confused here.....
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks. Missed that. Works great.
Change that line back and it should work:
Open in new window