Calling Batch File People

Page 1 of 3 123 LastLast

  1. Posts : 132
    windows 10
       #1

    Calling Batch File People


    For years on XP, Win7, Win8 & 8.1 I have used this batch file method to transfer pictures from a card reader to a (the same) directory on my computer. After upgrading to Win10 it no longer works.

    When I try to run it I get this:

    C:\Windows>dir J:\DCIM\198___07 1>nul
    C:\Windows>if errorlevel 1 goto :ck39Cannonempty
    C:\Windows>xCopy J:\DCIM\198___07\*.* /D /C
    J:\DCIM\198___07\IMG_99.JPG
    Access denied
    0 File(s) copied

    C:\Windows>pause
    I see what's wrong but don't know how to fix it. The entries in the batch file look exactly as the stuff following the right angle bracket in the text quoted above. Suddenly it has begun running as though the batch file was in the Windows directory (folder if you prefer). It isn't. It's still in my age old Card Transfer directory on a different internal drive.

    Why does Win10 think a batch file actually running in an entirely independent directory on a different drive is running in the Windows directory? And, how can I make it normal again?
    Last edited by iamjim; 18 Jul 2016 at 19:43.
      My Computer


  2. Posts : 4,752
    Windows 11 Pro 64 Bit 22H2
       #2

    What does your batch file look like?
      My Computer


  3. Posts : 15,441
    Windows10
       #3

    iamjim said:
    For years on XP, Win7, Win8 & 8.1 I have used this batch file method to transfer pictures from a card reader to a (the same) directory on my computer. After upgrading to Win10 it no longer works.

    When I try to run it I get this:



    I see what's wrong but don't know how to fix it. The entries in the batch file look exactly as the stuff following the right angle bracket in the text quoted above. Suddenly it has begun running as though the batch file was in the Windows directory (folder if you prefer). It isn't. It's still in my age old Card Transfer directory on a different internal drive.

    Why does Win10 think a batch file actually running in an entirely independent directory on a different drive is running in the Windows directory? And, how can I make it normal again?
    Well I see the xcopy command syntax looks all wrong for starters. it should look something like

    xcopy C:\somefolder E:\backupfolder /D /E /C /R /H /I /K /Y

    Also that command would try and copy all files to one file

    J:\DCIM\198___07\*.* to J:\DCIM\198___07\IMG_99.JPG

    just does not look right.
      My Computer


  4. Posts : 14,046
    Windows 11 Pro X64 22H2 22621.1848
       #4

    Put a cd %userprofile% at the beginning of the batch file maybe?
      My Computers


  5. Posts : 132
    windows 10
    Thread Starter
       #5

    spunk said:
    What does your batch file look like?
    dir J:\DCIM\198___07 > nul
    if errorlevel 1 goto :ck39Cannonempty
    xCopy J:\DCIM\198___07\*.* /D /C
    :ck39Cannonempty
    The first two lines interrogate the card to see if there's anything in the folder. If not, it jumps to the last line and quits.
    If there are files in the folder the third line copies them to the current directory.

    For some bizarre reason it thinks the current directory is Windows. Whaaaat?
    Last edited by iamjim; 18 Jul 2016 at 19:53.
      My Computer


  6. Posts : 132
    windows 10
    Thread Starter
       #6

    Ztruker said:
    Put a cd %userprofile% at the beginning of the batch file maybe?
    I can add a drive change and
    a CD to the target directory at the beginning of every batch file

    But, I have many batch files and so I would like to get it working right and avoid all that work
    Last edited by iamjim; 18 Jul 2016 at 19:54.
      My Computer


  7. Posts : 14,046
    Windows 11 Pro X64 22H2 22621.1848
       #7

    Tjis line, as said above, makes no sense:

    C:\Windows>xCopy J:\DCIM\198___07\*.* /D /C J:\DCIM\198___07\IMG_99.JPG

    As I read it, it says copy all files from the 198_07 directory (folder) to the same folder and call it IMG_99.JPG. If it worked, all files would end up as a single file.

    I doubt that is what you really want to do.

    I suspect the 2nd part should read something like: x:\DCIM\198___07\ where x: is the drive you want to copy to and \DCIM\198___07\ is the directory (folder) you want to copy them to on the x: drive.



    Can you explain in words exactly what you are trying to accomplish. Include drive and folder paths please.
      My Computers


  8. Posts : 132
    windows 10
    Thread Starter
       #8

    Perhaps you missed my post second before yours where I show and explain the batch file commands

    Incidentally there is no such line as C:\Windows>xCopy J:\DCIM\198___07\*.* /D /C J:\DCIM\198___07\IMG_99.JPG in the batch file.
      My Computer


  9. Posts : 414
    Windows 10 Pro
       #9

    Ztruker said:
    Tjis line, as said above, makes no sense:

    C:\Windows>xCopy J:\DCIM\198___07\*.* /D /C J:\DCIM\198___07\IMG_99.JPG
    Where did you see this line???

    The content of the OP's batch file is posted above. There's no such line there. And the batch file looks fine.
      My Computer


  10. Posts : 414
    Windows 10 Pro
       #10

    iamjim said:
    Why does Win10 think a batch file actually running in an entirely independent directory on a different drive is running in the Windows directory? And, how can I make it normal again?
    So, how do you invoke your batch file? Shortcut? Manually from command prompt? Some other way?
      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 00:22.
Find Us




Windows 10 Forums