Windows 10: windows short file name not the same when batch script accesses file on NAS

Discus and support windows short file name not the same when batch script accesses file on NAS in Windows 10 Network and Sharing to solve the problem; I first asked over at community for my DS918+ file system but it has been a week and all that happened was the moderator corrected my spelling of their... Discussion in 'Windows 10 Network and Sharing' started by Joseph Stateson, Nov 4, 2019.

  1. windows short file name not the same when batch script accesses file on NAS


    I first asked over at community for my DS918+ file system but it has been a week and all that happened was the moderator corrected my spelling of their product name.


    asked for help here first



    When "win_build" is shorted it has always been (AFAICT) "win_bu~1" but on my storage system it is actually

    Y:\VS2013projects\Src\boinc>dir/x win*
    Volume in drive Y is Archives
    Volume Serial Number is 2A24-E5D4
    Directory of Y:\VS2013projects\Src\boinc
    10/22/2019 09:45 AM <DIR> WOH7UM~G win_build



    This causes problems for the build script that contains

    SET BUILDROOT=%~dps0
    SET BUILDROOT=%BUILDROOT:\win_bu~1\=%

    I poked around over at that stackoverflow place and came up with a solution for the above

    for %%I in (.) do SET SHORT_WIN_BUILD=%%~nsxI

    The above works fine and gets that awful "W0H7UM~G" but as mentioned over at the synology community there is a bigger problem than the 8dot3name being different.


    I assume Microsoft windows 10 is shortening the names a different way. Is there a way to force the old method to be used so that win_bu~1 shows up instead of WOH7UM~G ?


    Thanks for looking and I double checked this for speeling errors before posting

    :)
     
    Joseph Stateson, Nov 4, 2019
    #1
  2. HAT
    hat Win User

    Batch file needs tweaking

    I've been using AviSynth for deinterlacing and tetelecining TV series lately, and in the process I have to write many scripts for each episode. I've found a batch file that pretty much automates this, but there is one issue. For example, if my source file is "Monk s01e01.mkv", the script the batch file gives me is named "Monk s01e01.mkv.avs". As the files AviSynth produces go by the name of the AVS script, if I processed the script with that name, the resulting file would be "Monk s01e01.mkv.avi". I need to get the .mkv part out of the .avs script the batch file produces. This is the batch file:

    Code: for %%n in (*.mkv*) do ( echo setmtmode(5,4^) > "%%n.avs" echo ffmpegsource2("%%n"^) >> "%%n.avs" echo setmtmode(2^) >> "%%n.avs" echo qtgmc(edithreads=2^) >> "%%n.avs" echo selecteven(^) >> "%%n.avs" )[/quote] So, any way to get the .mkv out of the files produced by this batch file? It really beats having to write a script for each episode individually.
     
  3. Bentley12 Win User
    Batch File to list files from two seperat networks

    Hello,

    I work in a factory where multiple PCs are on seperate VLANs. I need to view contents of a directory from one VLAN called "Admin" and compare it with individual directories from multiple PCs on another VLAN called "Shop" ("Shop" is not part of the Domain)

    I have created a VB script that will compare two txt files and report the diffences. So I am trying to create two text files from each VLAN using a batch file. The batch file will be ran from a PC with two network cards so it can see both VLANs.

    I can easily create the list from the "Admin" network using:
    dir /b \\Server\Share\ > Active.txt

    The "Shop" list is different. It needs a username and password. All Shop PCs have the same user name and password but I'm not sure how to structure the script to create a list from multiple PCs using a user name and password.
    If I open the folders from Windows and enter the credentials then a script like this will work:
    dir /b \\PC_Name1\Share > Programs.txt
    dir /b \\PC_Name2\Share >> Programs.txt

    Using the command above without first opening the folder and entering the credentials gives this error: Logon failure: unknown user name or bad password

    Thanks in advance for any help.
     
    Bentley12, Nov 4, 2019
    #3
  4. ABauer Win User

    windows short file name not the same when batch script accesses file on NAS

    vb.net app has no read access to local files

    Thanks for the quick reply! I am using full path names for all file references and all script files are in the same directory as both the app and the created batch file.
     
    ABauer, Nov 4, 2019
    #4
Thema:

windows short file name not the same when batch script accesses file on NAS

Loading...
  1. windows short file name not the same when batch script accesses file on NAS - Similar Threads - short file name

  2. Batch Script Adding a Period . to File Name

    in Windows 10 Gaming
    Batch Script Adding a Period . to File Name: Hi, I am testing a script to find the last file within a folder.It can locate the correct file, but the resulting variable includes a period . within the file name.Here's the script:REM Copy the recent Friday evening's Diff Backup onto the drive G: My Passport device.@echo...
  3. Batch Script Adding a Period . to File Name

    in Windows 10 Software and Apps
    Batch Script Adding a Period . to File Name: Hi, I am testing a script to find the last file within a folder.It can locate the correct file, but the resulting variable includes a period . within the file name.Here's the script:REM Copy the recent Friday evening's Diff Backup onto the drive G: My Passport device.@echo...
  4. Batch shorten file names

    in Windows 10 Gaming
    Batch shorten file names: Hi everyone!I have a bunch of files for work, which all have a name like 'FunTimes-party2020', 'BossMan-party2020', 'GroupPhoto-party2020' just as a example.I need to shorten the names of the files in the example, remove the "party2020", but there are hundreds of files. Is...
  5. Batch shorten file names

    in Windows 10 Software and Apps
    Batch shorten file names: Hi everyone!I have a bunch of files for work, which all have a name like 'FunTimes-party2020', 'BossMan-party2020', 'GroupPhoto-party2020' just as a example.I need to shorten the names of the files in the example, remove the "party2020", but there are hundreds of files. Is...
  6. Batch file to move all the files to folders that start with the same name

    in Windows 10 Network and Sharing
    Batch file to move all the files to folders that start with the same name: I have a folder with pdf files like this TCH_123.pdf TCH_573.pdf EHUB_456.pdf EHUB_764.pdf and subfolders with names like TCH and EHUB I want to write a batch file to move all the files to the folder with the name that the files start with. I am a total beginner to...
  7. [Question] Delete files with denied access with batch scripts

    in Windows 10 Support
    [Question] Delete files with denied access with batch scripts: Ciao, dopo anni ho iniziato a lavorare con script batch di nuovo, ma non riesco a eliminare un file nella directory principale "C", (usando W10 ultima release), questo è lo script che mi d "accesso negato". [code] @echo off cls del "C: \ SYSTAG.BIN" / A / F / Q / S...
  8. Batch file Script to reboot when no Internet Connection detected?

    in Windows 10 Support
    Batch file Script to reboot when no Internet Connection detected?: from time to time my Windows 10 Laptop is unable to connect to the wireless network. Tried literally every other "fix"! The only solution is to reboot the LapTop when this happens... The best idea I've come up with is to schedule a task to run a script when the computer...
  9. Running PowerShell script as a batch file

    in Windows 10 Network and Sharing
    Running PowerShell script as a batch file: Can I run the Power Shell line: "C:\Windows\System32>get-appxpackage *3dbuilder* | remove-appxpackage" from a .Bat file? ***Original title: Removing bloatware***...
  10. Cannot access files on Nas

    in Windows 10 Network and Sharing
    Cannot access files on Nas: On 1803 (latest update) & 1809 I cannot access files on my nas or connect to my Nas web gui with jumbo frames enabled. This is happening on Intel & Realtek nic's. This had been working on all machines until the latest update Win10 Pro and Home. Disabling jumbo frames...