WWWBatch.ini on a Windows/2008 server

Started by rmelcher, April 02, 2015, 08:24:33 AM

Previous topic - Next topic

rmelcher

Where is the WWWBatch.ini file saved on Windows/2008 server ?  I have a WntAccessMod command intermittently failing with a 546 error and I need more information.  Any other suggestions would be appreciated.   Just prior to the WntAccessMod I check to see if the Dir Exists.     

td

Since the release of Windows Vista in 2007 the wwwbatch.ini file has been located in the %systemdrive%:\Users\%username%\AppData\Roaming\WinBatch\Settings folder.  This includes Windows 2008 and all subsequent server and client version of Windows.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

rmelcher

I continue to work on this 546 error.  I installed WinBatch 2015A.  Iââ,¬Ëœm now testing on a Windows 7 64 bit computer, the userid Iââ,¬â,,¢m using is a local admin.   The program continues to fail in the same location with a 546 error.
wntAccessAdd("%sa_filesrv%","%pathdir%","xxx",303,"Dir:Full",0)
I can see that the folder that Iââ,¬â,,¢m targeting does exist, DirExist just prior to wntAccessAdd, and the funny thing is that the operation I requesting does work, but I get an Error 546.  (Captured by IntControl(73,1,@true,0,0) and reported by wberrorarray[5].)  I canââ,¬â,,¢t find the WWWBatch ini  file. I looked in C:\Users\uuu\AppData\Roaming\WinBatch\Settings, the folder is empty!   I compiled and tested the program both 32 bit and 64 bit modes.   Any suggestions would be appreciated.
(I had to sanitize the log)
pathdir = strcat(target_folder,"\Macros")
(219) VALUE STRING => "\\ncsusrasasc3.na.xxx.com\bcih\bnp\test1\yyy\Macros"

rc = dirmake(pathdir)
(234) VALUE INT => 1

if rc <> @true
(234) END OPERATOR

pathdir = strcat(target_folder,"\Macros\Archive")
(234) VALUE STRING => "\\ncsusrasasc3.na.xxxj.com\bcih\bnp\test1\yyy\Macros\Archive"

rc = dirmake(pathdir)
(265) VALUE INT => 1

if rc <> @true
(265) END OPERATOR

for i = 1 to 10
(265) FOR TRUE==>1

If DirExist(pathdir) == @true then Break
(265) END OPERATOR

if i > 10
(265) END OPERATOR

rc = wntAccessAdd(sa_filesrv,pathdir,"NA\uuu",303,"Dir:Full",0)
(297) VALUE INT => 0

EXTENDER ERROR SUPPRESSED =>546 (546: Invalid file/directory name)

td

The wwwbatch.ini is only created if WinBatch or one of the extenders needs to write to it and it is always create in the previously mentioned location (assuming you are using the latest version of the extender.)

The logic of your script looks suspect but it is hard to say much about it since you did not provide a more complete trace.

Also keep in mind that being an admin is not sufficient to perform an admin tasks on Windows 7 with UAC enabled.  Your script must be compiled with either the 'highestAvailable' or 'requiresAdministator' manifest settings.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

rmelcher

Below is more of the trace.  You can see the version of the DDL being loaded (Extender loaded: \\itsusmpw01048\SPMT\Bin\wwwnt34i.dll (file version: 39023,0,0,1))

The trace had to be sanitized

The account running the script does not have local admin rights, but the account is not modifying rights on the local server but rather a remote server, where it does have full control.  If you notice in the trace some of the permission modifications are working, the Winbatrch script just randomly cancels.  In fact the account being added in the command that cancelled was inserted.   


************************************************************
*** Debug Initialized ***
==============================
Fri 4/10/2015 2:10:22 PM
WinBatch 32 2015A
WIL DLL 6.15aoa
\\itsusmpw01048\SPMT\Bin\mkprot_2.exe
Windows platform: NT, version: 6.1, build: 7601 (Service Pack 1)
ErrorMode: @NOTIFY
Valid Code Signature: No
UAC Manifest Settings: level="asInvoker" uiAccess="false"
UAC Elevation Level: Standard User or Disabled
==============================
programmer_group_list    = Strcat("NA\RNDUS_<xxx>_USERS")
(0) VALUE STRING => "NA\RNDUS_<xxx>_USERS"
to_group_techops          = Strcat("NA\RNDUS_<xxx>_TECHOPS")
(0) VALUE STRING => "NA\RNDUS_<xxx>_TECHOPS"
Superuser_group_techops = Strcat("NA\RNDUS_<xxx>_SUPER_USER")
(16) VALUE STRING => "NA\RNDUS_<xxx>_SUPER_USER"
PDev_runner             = Strcat("NA\SA-PRD-<xxx>-PDevRun")
(16) VALUE STRING => "NA\SA-PRD-<xxx>-PDevRun"
pathdir = strcat(target_folder,"\Docs")
(16) VALUE STRING => "\\<some server>.na.<some Domain>.com\bcih\<xxx>\test1\xxxxxxx12\Docs"
rc = dirmake(pathdir)
(47) VALUE INT => 1
if rc <> @true
(47) END OPERATOR
for i = 1 to 10
(47) FOR TRUE==>1
If DirExist(pathdir) == @true then Break
(63) END OPERATOR
if i == 11
(63) END OPERATOR
rc = wntAccessMod(sa_filesrv,pathdir,300,2,0)
(125) VALUE INT => 1
if rc <> @true
(125) END OPERATOR
pathdir = strcat(target_folder,"\Docs")
(125) VALUE STRING => "\\<some server>.na.<some Domain>.com\bcih\<xxx>\test1\xxxxxxx12\Docs"
rc = wntAccessMod(sa_filesrv,pathdir,300,2,0)
(156) VALUE INT => 1
if rc <> @true
(156) END OPERATOR
rc=SetAccess("\\<some server>.na.<some Domain>.com\bcih\<xxx>\test1\xxxxxxx12\Docs","NA\RNDUS_<xxx>_USERS",303,"0:9:-536805376|0:2:1245631")
(156) CALLING UDF (setaccess)
RETURNING FROM UDF (setaccess)
rc=SetAccess("\\<some server>.na.<some Domain>.com\bcih\<xxx>\test1\xxxxxxx12\Docs","NA\RNDUS_<xxx>_USERS",303,"0:9:-536805376|0:2:1245631")
(219) RETURN VALUE INT => 0
if rc <> 0 then goto error_out
(219) ==>FALSE=> (skipped)
pathdir = strcat(target_folder,"\Macros")
(219) VALUE STRING => "\\<some server>.na.<some Domain>.com\bcih\<xxx>\test1\xxxxxxx12\Macros"

rc = dirmake(pathdir)
(234) VALUE INT => 1

if rc <> @true
(234) END OPERATOR

pathdir = strcat(target_folder,"\Macros\Archive")
(234) VALUE STRING => "\\<some server>.na.<some Domain>.com\bcih\<xxx>\test1\xxxxxxx12\Macros\Archive"

rc = dirmake(pathdir)
(265) VALUE INT => 1

if rc <> @true
(265) END OPERATOR

for i = 1 to 10
(265) FOR TRUE==>1

If DirExist(pathdir) == @true then Break
(265) END OPERATOR

if i > 10
(265) END OPERATOR

rc = wntAccessAdd(sa_filesrv,pathdir,"NA\<some User>",303,"Dir:Full",0)
(297) VALUE INT => 0

EXTENDER ERROR SUPPRESSED =>546 (546: Invalid file/directory name)

debugtrace_env =  Environment("debugtrace")
(312) VALUE STRING => ""

if debugtrace_env <> "" then Debugtrace(@on,debugtrace_env)
(312) ==>FALSE=> (skipped)

IntControl(73,0,@true,0,0)
(312) VALUE STRING => "0"

error_msg0 = Strcat("Full_path='",pathdir,"'",@crlf)
(312) VALUE STRING => "Full_path='\\<some server>.na.<some Domain>.com\bcih\<xxx>\test1\xxxxxxx12\Macros\Archive'
"

error_msg1 = StrCat("Error Line:=",wberrorarray[1], @crlf)
(312) VALUE STRING => "Error Line:=rc = wntAccessAdd(sa_filesrv,pathdir,"NA\<some User>",303,"Dir:Full",0)
"

error_msg2 = StrCat("Error Line Num:=",wberrorarray[8], @crlf)
(312) VALUE STRING => "Error Line Num:=365
"

error_msg3 = StrCat("Script Name:=",wberrorarray[4], @crlf)
(312) VALUE STRING => "Script Name:=\\rarusrafps07.na.<some Domain>.com\HomeH$\Rxxxxxxx\Data\WinBatch\mkprot_2.wbt
"

error_msg4 = StrCat("Error Desc:=",wberrorarray[5], @crlf)
(312) VALUE STRING => "Error Desc:=546: Invalid file/directory name
"

error_msg5 = StrCat("Variable:=",wberrorarray[3], @crlf)
(312) VALUE STRING => "Variable:=rc
"

error_msg6 = StrCat("Additional Info:=",wberrorarray[6], @crlf)
(312) VALUE STRING => "Additional Info:=
"

error_msg7 = StrCat("sa_filesrv:='",sa_filesrv,"'", @crlf)
(312) VALUE STRING => "sa_filesrv:=''
"

return_message = strcat(error_msg0, error_msg1, error_msg2, error_msg3, error_msg4,error_msg5, error_msg6, error_msg7)
(312) VALUE STRING => "Full_path='\\<some server>.na.<some Domain>.com\bcih\<xxx>\test1\xxxxxxx12\Macros\Archive'
Error Line:=rc = wntAccessAdd(sa_filesrv,pathdir,"NA\<some User>",303,"Dir:Full",0)
Error Line Num:=365
Script Name:=\\rarusrafps07.na.<some Domain>.com\HomeH$\Rxxxxxxx\Data\WinBatch\mkprot_2.wbt
Error Desc:=546: Invalid file/directory name
Variable:=rc
Additional Info:=
sa_filesrv:=''
"

----- Extender loaded: \\itsusmpw01048\SPMT\Bin\wwwnt34i.dll (file version: 39023,0,0,1)

AddExtender('wwwnt34i.dll',0,'wwwnt64i.dll')
(312) VALUE INT => 1

exec_path_fn = StrUpper(WinExeName(""))
(312) VALUE STRING => "\\ITSUSMPW01048\SPMT\BIN\MKPROT_2.EXE"

exec_fn        = FileRoot(exec_path_fn)
(312) VALUE UNICODE => MKPROT_2

wntEventWrite("",exec_fn,262144,3,return_message)
(312) VALUE INT => 1

return_code = 999
(312) VALUE INT => 999

goto error_out
(312) VALUE INT => 0

if return_code >= 0
(312) IF DO==>TRUE

----- Extender loaded: \\itsusmpw01048\SPMT\Bin\wwwnt34i.dll (file version: 39023,0,0,1)

AddExtender("WWWNT34I.DLL")
(312) VALUE INT => 1

exec_path_fn = StrUpper(WinExeName(""))
(312) VALUE STRING => "\\ITSUSMPW01048\SPMT\BIN\MKPROT_2.EXE"

exec_fn        = FileRoot(exec_path_fn)
(312) VALUE UNICODE => MKPROT_2

wntEventWrite("",exec_fn,262144,3,return_message)
(328) VALUE INT => 1

endif
(328) END OPERATOR

if return_file_rc_fh <> ""
(328) IF DO==>TRUE

FileWrite(return_file_rc_fh,return_code)
(328) VALUE INT => 0

FileClose(return_file_rc_fh)
(328) VALUE INT => 0

endif
(328) END OPERATOR

if return_file_msg_fh <> ""
(328) IF DO==>TRUE

FileWrite(return_file_msg_fh,return_message)
(328) VALUE INT => 0

FileClose(return_file_msg_fh)
(328) VALUE INT => 0

endif
(328) END OPERATOR

if fh <> "" then FileClose(fh)
(328) ==>TRUE=> 0

exit
(328) VALUE INT => 0

--- Normal termination ---

;;;END OF JOB;;;

td

The trace still looks overly doctored but presumably you mean that it randomly errors because it isn't just cancelling.  The trace shows that the script is doing what you have instructed it to do when it encounters an error.

The 546 error is returned by the extender function when the system reports one of the following three error codes:

  • ERROR_FILE_NOT_FOUND
  • ERROR_PATH_NOT_FOUND
  • ERROR_INVALID_NAME

You would need to locate the wwwbatch.ini file to determine which of the three is causing the error.

So either one of those three things must be the case or the underlying Window network API is not setting the correct error code.  Given that the former is the more likely scenario, it is possible that your problem is the result of some very brief intermittent SMB protocol or network transport outage of some kind.   If that seems to be the case,  you might consider trapping the error and then performing a retry after a brief pause.    You could also consider looking at the network packet traffic, if you have the tools at your disposal. The system event log may or may not also provide some insight. 
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade