Batch file on network drive only works on some machines

Page 3 of 3 FirstFirst 123

  1. Posts : 1,746
    Windows 10 Pro x64 22H2
       #21

    Here are few other suggestions:
    On a computer which is having this issue make sure the following services are running, restart if running:
    1. LanmanWorkstation: Workstation
    2. LanmanServer: Server
    3. lmhosts: TCP/IP NetBIOS Helper service
    4. WinRM: Windows Remote Management (WS-Management)
    5. RemoteRegistry Remote Registry
    6. FDResPub Function Discovery Resource Publication
    7. fdPHost Function Discovery Provider host


    First verify the following network adapter items are enabled (checked) and if not restart adapter for any changes to take effect:
    (right click adapter in control panel -> network and sharing center -> adapter settings -> adapter -> properties)

    1. Client for Microsoft Networks
    2. File and Printer Sharing for Microsoft Networks
    3. Internet Protocol version 4 (TCP/IPv4)
    4. Internet Protocol version 6 (TCP/IPv6)
    5. Link-Layer Topology Discovery Responder
    6. Link-Layer Topology Discovery I/O Driver
      My Computer


  2. Posts : 11
    Windows 10
    Thread Starter
       #22

    F22 Simpilot said:
    Does not compute.


    On the surface it seems maybe it's a permission issue. Just for "giggles" add all this crap above your batch code, then manually fire off your batch code and see if the stats and logs are generated.

    Code:
    @echo off
    
    :: BatchGotAdmin
    :-------------------------------------
    REM  --> Check for permissions
        IF "%PROCESSOR_ARCHITECTURE%" EQU "amd64" (
    >nul 2>&1 "%SYSTEMROOT%\SysWOW64\cacls.exe" "%SYSTEMROOT%\SysWOW64\config\system"
    ) ELSE (
    >nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
    )
    
    REM --> If error flag set, we do not have admin.
    if '%errorlevel%' NEQ '0' (
        echo Requesting administrative privileges...
        goto UACPrompt
    ) else ( goto gotAdmin )
    
    :UACPrompt
        echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
        set params= %*
        echo UAC.ShellExecute "cmd.exe", "/c ""%~s0"" %params:"=""%", "", "runas", 1 >> "%temp%\getadmin.vbs"
    
        "%temp%\getadmin.vbs"
        del "%temp%\getadmin.vbs"
        exit /B
    
    :gotAdmin
        pushd "%CD%"
        CD /D "%~dp0"
    :--------------------------------------
    Just a shot in the dark here. Maybe there's a NetBIOS issue of some sorts.
    Thank you. I ran this on two machines, one that works and one that doesn't. The result is the same on both and a screenshot is attached.

    c:\windows\system32 is in the PATH and CMD.EXE is where it should be in that directory. I also ran the Diagnose which I have already done previously and that found no problems.

    I turned off the firewall and re-ran it with the same result on both. The machine that doesn't work is an active FTP server with the FTP log and config files on Z: drive so I know the mapping and network connection is fine.

    Batch file on network drive only works on some machines-network-error.jpg
    Last edited by Leora; 24 Jun 2023 at 06:01.
      My Computer


  3. Posts : 295
    Windows 10 Pro
       #23

    Leora said:
    The config does equal the website name which is also the name of the config file.

    I'm wondering if that could be a problem?

    Also, -awstatsprog=z:/awstats/wwwroot/cgi-bin/awstats.pl

    I haven't gone over the syntax, but perhaps there needs a to be a space after the = (?)

    Can you try running some other batch file from the share and seeing if that executes? It seems permissions is doing this. I guess Z drive is accessible via all the computers?

    Run this command on the problematic machines. nbtstat -n. Any issues shown?

    Edit-

    Check this out: Ping A List Of Computers and Double Check DNS name against NetBios name | chentiangemalc
      My Computer


  4. Posts : 295
    Windows 10 Pro
       #24

    Test your Perl installation on the problematic computers. Testing Your Perl Installation

    Read this.

    Read this too.

    Here's another.

    Extras:

    Apache Guacamole™

    Matomo Analytics - The Google Analytics alternative that protects your data

    Matomo is very easy to setup.

    Cockpit Project — Cockpit Project

    There's also Webmin...
      My Computer


  5. Posts : 11
    Windows 10
    Thread Starter
       #25

    F22 Simpilot said:
    I'm wondering if that could be a problem?

    Also, -awstatsprog=z:/awstats/wwwroot/cgi-bin/awstats.pl

    I haven't gone over the syntax, but perhaps there needs a to be a space after the = (?)

    Can you try running some other batch file from the share and seeing if that executes? It seems permissions is doing this. I guess Z drive is accessible via all the computers?

    Run this command on the problematic machines. nbtstat -n. Any issues shown?

    Edit-

    Check this out: Ping A List Of Computers and Double Check DNS name against NetBios name | chentiangemalc
    Thanks for your reply.

    The syntax for AWStats is correct. It works on 3 machines.

    nbtstat shows no problems. Everything is registered. NETBios has been gone over and all computer use the same settings and DNS servers. The same thing has been done for Windows Features.

    Every other batch file runs fine from the network share drive. Even the AWStats batch file executes properly until it reaches the AWStats command line.

    It's not permissions. The directories have EVERYONE permissions and its been tried from C: drives on several machines with the same failure. Any other batch file tried from the network works fine.

    The mapping is correct because all the machines have Apache web server and XLight FTP server installations as backups. Those services start fine and all the dependent data is on the network share drive.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 05:05.
Find Us




Windows 10 Forums