Loading ...
Sorry, an error occurred while loading the content.
 

Re: [BATCH WORLD] Accessing a shared file within a bat file

Expand Messages
  • foxidrive
    On Mon, 05 May 2008 19:26:04 -0700, Gary Kuznitz ... As it worked with a mapped drive then perhaps irfanview doesn t grok UNC paths.
    Message 1 of 9 , May 6, 2008
      On Mon, 05 May 2008 19:26:04 -0700, "Gary Kuznitz" <docfxit@...>
      wrote:

      >> >I'm having a problem running a bat file in XP Pro. I'm running it with:
      >> >
      >> >RUNRMTCMD CMD('C:\BATCH\SCAN.BAT 00155900000.TIF') RMTLOCNAME('192.168.1.4'
      >> >*IP) RMTUSER('B') RMTPWD(hidden) The above command is run from computer A on
      >> >computer B.
      >> >
      >> >The bat file that runs on computer B looks like this:
      >> >C:\Batch\hstart.exe /NOWINDOW /D=C:\PROGRA~1\IRFANVIEW
      >> >"C:\PROGRA~1\IRFANVIEW\I_VIEW32 \\Atu1277\SCANS\%1"
      >> >
      >> >The above is on one line.
      >> >
      >> >The error I get is:
      >> >
      >> >\\Atu1277\SCANS\00155900000.TIF : Can't read file header !
      >> >Unknown file format or file not found.

      As it worked with a mapped drive then perhaps irfanview doesn't grok UNC
      paths.

      Try just the batch

      "C:\PROGRA~1\IRFANVIEW\I_VIEW32 \\Atu1277\SCANS\%1"

      on a local machine and see if it has the same issue.
    • Gary Kuznitz
      Thanks for the reply. ... It has the same error. I looked into your suggestion of maybe the network is not available to a user that is not logged in. Someone
      Message 2 of 9 , May 6, 2008
        Thanks for the reply.

        On 6 May 2008 at 19:38, foxidrive (foxidrive <batchworld@yahoogroups.com>) commented about Re: [BATCH WORLD] Accessing a shared file within :

        > On Mon, 05 May 2008 19:26:04 -0700, "Gary Kuznitz" <docfxit@...>
        > wrote:
        >
        > >> >I'm having a problem running a bat file in XP Pro. I'm running it with:
        > >> >
        > >> >RUNRMTCMD CMD('C:\BATCH\SCAN.BAT 00155900000.TIF') RMTLOCNAME('192.168.1.4'
        > >> >*IP) RMTUSER('B') RMTPWD(hidden) The above command is run from computer A on
        > >> >computer B.
        > >> >
        > >> >The bat file that runs on computer B looks like this:
        > >> >C:\Batch\hstart.exe /NOWINDOW /D=C:\PROGRA~1\IRFANVIEW
        > >> >"C:\PROGRA~1\IRFANVIEW\I_VIEW32 \\Atu1277\SCANS\%1"
        > >> >
        > >> >The above is on one line.
        > >> >
        > >> >The error I get is:
        > >> >
        > >> >\\Atu1277\SCANS\00155900000.TIF : Can't read file header !
        > >> >Unknown file format or file not found.
        >
        > As it worked with a mapped drive then perhaps irfanview doesn't grok UNC
        > paths.
        >
        > Try just the batch
        >
        > "C:\PROGRA~1\IRFANVIEW\I_VIEW32 \\Atu1277\SCANS\%1"
        >
        > on a local machine and see if it has the same issue.

        It has the same error.

        I looked into your suggestion of maybe the network is not available to a user
        that is not logged in. Someone else had a solution. I adapted it to this
        install and ran a test with this bat file:

        Start of bat file:
        ::ListScansFiles -- this script will list the files from L: drive.
        ::
        @echo off
        SETLOCAL ENABLEEXTENSIONS
        SETLOCAL ENABLEDELAYEDEXPANSION
        echo execution of ListScansFiles started %date%-%time% >>
        C:\SCRATCH\ListScansFiles.log
        net use L: \\ATU1277\Scans <password> /user:b persistance=no
        L:
        cd \
        for %%F in (*.*) do (
        echo ***** %%~nxF Exist in L:\ >> C:\SCRATCH\ListScansFiles.log *****
        )
        echo execution of ListScansFiles ended %date%-%time% >>
        C:\SCRATCH\ListScansFiles.log
        C:
        net use L: /delete
        exit
        End of Bat file. If a line starts in Column one it wrapped.

        I expected it to list all the files in \\ATU1277\Scans.
        Instead it listed all the files on the C: drive of the local machine.

        This is only meant for a test to see if I can connect to the network.

        Any ideas why it didn't list the network drive?

        Thank you,

        Gary Kuznitz
      • foxidrive
        On Tue, 06 May 2008 13:30:10 -0700, Gary Kuznitz ... Your command syntax looks to be wrong. /PERSISTENT:NO NET USE [devicename | *]
        Message 3 of 9 , May 6, 2008
          On Tue, 06 May 2008 13:30:10 -0700, "Gary Kuznitz" <docfxit@...>
          wrote:

          > net use L: \\ATU1277\Scans <password> /user:b persistance=no

          Your command syntax looks to be wrong.


          /PERSISTENT:NO





          NET USE
          [devicename | *] [\\computername\sharename[\volume] [password | *]]
          [/USER:[domainname\]username]
          [/USER:[dotted domain name\]username]
          [/USER:[username@dotted domain name]
          [/SMARTCARD]
          [/SAVECRED]
          [[/DELETE] | [/PERSISTENT:{YES | NO}]]

          NET USE {devicename | *} [password | *] /HOME

          NET USE [/PERSISTENT:{YES | NO}]
        Your message has been successfully submitted and would be delivered to recipients shortly.