How to use findstr on a hidden Ollama app.log file?


bacca400

Member
Local time
7:32 PM
Posts
4
OS
Windows 11
Background.

  1. I have a Desktop shortcut to open a cmd.exe window to the Ollama directory program. This shortcut also runs a .bat file to set up some paths and other environment variables.

The concept is simple. I want to search for the string OLLAMA_MODEL in the file `C:\Users\USERNAME\AppData\Local\Ollama` but the OS says it cannot find the file. The file appears to be hidden. I can use the File Explorer to open the directory. I'm the only user on this home machine so I'm also the admin.

I also tried copying the file to another directory but the error I get is "Cannot find file". So how do I search this file if I'm the admin user, to find the string I want?

My .bat file looks like this currently:

Code:
@echo off
rem Updated: 3/30/25
rem This file seems to be hidden: C:\Users\USERNAME\.ollama\models\app.log
set tfile=C:\Users\USERNAME\.ollama\models\app.log
set tfile2=.\app.log
copy %tfile% %tfile2%
if %ERRORLEVEL% NEQ 0  (
          echo ERROR: File could not be copied!
          goto myexit
)
findstr /i /n OLLAMA_MODEL %tfile2%
:myexit

This also gives me an error "File not found".

Code:
@echo off
rem Updated: 3/30/25
rem Ollama is in c:\users\USERNAME\AppData\Local\Programs\Ollama\
rem This file seems to be hidden: C:\Users\USERNAME\.ollama\models\app.log
set tfile=C:\Users\USERNAME\.ollama\models\app.log

dir /s /b /a:H %tfile% | findstr /i /c:"OLLAMA_MODEL: %tfile%
:myexit
 
Last edited:

My Computer My Computer

At a glance

Windows 11AMD Ryzen 5 5600G with Radeon Graphics 6 cores16GBNvideo GeForce RTX 3060
OS
Windows 11
Computer type
PC/Desktop
Manufacturer/Model
HP Omen GT13-1xxx
CPU
AMD Ryzen 5 5600G with Radeon Graphics 6 cores
Memory
16GB
Graphics Card(s)
Nvideo GeForce RTX 3060
Hard Drives
C: SSD, with other hard drives from old PCs.
Is there also a missing closing quote for the search string "OLLAMA_MODEL: ?

Also, to try & copy the hidden file, first try and remove its Attributes with Attrib, then after the copy you can reverse the Attrib if required on the source/destination file.
try:
Code:
rem This file seems to be hidden: C:\Users\USERNAME\.ollama\models\app.log
set                tfile=C:\Users\USERNAME\.ollama\models\app.log
Attrib -R -A -S -H C:\Users\USERNAME\.ollama\models\app.log
set tfile2=.\app.log
copy %tfile% %tfile2%
if %ERRORLEVEL% NEQ 0  (
          echo ERROR: File could not be copied!
          goto myexit
)
findstr /i /n OLLAMA_MODEL %tfile2%
:myexit
 
Last edited:

My Computer My Computer

At a glance

Win 11 25H2intel i7-870032GbIntel iGPU
OS
Win 11 25H2
Computer type
PC/Desktop
Manufacturer/Model
custom
CPU
intel i7-8700
Motherboard
Asus Z370 TUF Gaming
Memory
32Gb
Graphics Card(s)
Intel iGPU
Sound Card
Realtek
Hard Drives
Samsung
PSU
Corsair
Cooling
Fans
  • Like
Reactions: OAT
Consider everything search, I find it invaluable for many searches. If finds hidden files just fine. It's fast and convenient.
 

My Computers My Computers

  • At a glance

    Win 11 Pro 25H2, Build 26200.8894Intel Core i5 1450064GB DDR4GeForce RTX 4060
    OS
    Win 11 Pro 25H2, Build 26200.8894
    Computer type
    PC/Desktop
    Manufacturer/Model
    Home Brew
    CPU
    Intel Core i5 14500
    Motherboard
    Gigabyte B760M G P WIFI
    Memory
    64GB DDR4
    Graphics Card(s)
    GeForce RTX 4060
    Sound Card
    Chipset Realtek
    Monitor(s) Displays
    LG 45" Ultragear, Acer 24" 1080p
    Screen Resolution
    5120x1440, 1920x1080
    Hard Drives
    Crucial P310 2TB 2280 PCIe Gen4 3D NAND NVMe M.2 SSD (O/S)
    Silicon Power 2TB US75 NVMe PCIe Gen4 M.2 2280 SSD (backup)
    Crucial BX500 2TB 3D NAND (2nd backup)
    Seagate 4TB Ironwolf, rotating HDD archive files
    External off-line backup Drives: 2 NVMe 4TB drives in external enclosures
    PSU
    Thermaltake Toughpower GF3 750W
    Case
    LIAN LI LANCOOL 216 E-ATX PC Case
    Cooling
    Lots of fans!
    Keyboard
    Microsoft Comfort Curve 2000
    Mouse
    Logitech G305
    Internet Speed
    Verizon FiOS 1GB
    Browser
    Firefox
    Antivirus
    Malware Bytes & Windows Defender Security
  • At a glance

    Win 11 Pro 25H2, Build 26200.8894Intel Core i5 1440032GB DDR5Intel 700 Embedded GPU
    Operating System
    Win 11 Pro 25H2, Build 26200.8894
    Computer type
    PC/Desktop
    Manufacturer/Model
    Home Brew
    CPU
    Intel Core i5 14400
    Motherboard
    Gigabyte B760M DS3H AX
    Memory
    32GB DDR5
    Graphics card(s)
    Intel 700 Embedded GPU
    Sound Card
    Realtek Embedded
    Monitor(s) Displays
    27" HP 1080p
    Screen Resolution
    1920x1080
    Hard Drives
    Crucial P310 2TB 2280 PCIe Gen4 eD NAND PCIe SSD
    Samsung EVO 990 2TB NVMe Gen4 SSD
    Samsung 2TB SATA SSD
    PSU
    Thermaltake Smart BM3 650W
    Case
    Okinos Micro ATX Case
    Cooling
    Fans
    Keyboard
    Microsoft Comfort Curve 2000
    Mouse
    Logitech G305
    Internet Speed
    Verizon FiOS 1GB
    Browser
    Firefox
    Antivirus
    Malware Bytes & Windows Defender Security
  • Nimo N171 17" Laptop, (Intel i3-1215U, 16GB RAM, 2TB NVMe, Win11 Pro)
    Acemagic Vista Mini PC V1 (Intel N150, 16GB RAM, 1TB NVMe, Win11 Pro)
    HP ENVY h8-1540t, (24GB RAM, 2TB SSD, 2TB HDD, Win11 Pro)

My Computers My Computers

  • At a glance

    All Branches but ReleaseAMD Ryzen 7 7735HS 3200-4500 Mhz 8 cores x 232 GB DDR5Radeon Graphic / NVIDIA GeForce RTX 4060 8 GB...
    OS
    All Branches but Release
    Computer type
    Laptop
    Manufacturer/Model
    Acer Nitro ANV15-51
    CPU
    AMD Ryzen 7 7735HS 3200-4500 Mhz 8 cores x 2
    Motherboard
    Sportage_RBH
    Memory
    32 GB DDR5
    Graphics Card(s)
    Radeon Graphic / NVIDIA GeForce RTX 4060 8 GB GDDR6
    Sound Card
    AMD/Realtek(R) Audio
    Monitor(s) Displays
    Integrated Monitor (15.3"vis)
    Screen Resolution
    FHD 1920X1080 16:9 144Hz
    Hard Drives
    KINGSTON OM8SEP4512Q-AA 1TB
    Western Digital 256GB
    PSU
    19V DC 6.32 A 120 W
    Cooling
    Dual Fans
    Mouse
    MS Bluetooth
    Internet Speed
    Fiber 1GB Cox -us & 1GB Orange-fr
    Browser
    Edge Canary- Firefox Nightly-Chrome Dev-Chrome Dev
    Antivirus
    Windows Defender
  • At a glance

    Windows 11 BetaAMD A9-94208 GB of DDR4AMD Radeon R5
    Operating System
    Windows 11 Beta
    Computer type
    Laptop
    Manufacturer/Model
    Asus X751BP
    CPU
    AMD A9-9420
    Memory
    8 GB of DDR4
    Graphics card(s)
    AMD Radeon R5
    Screen Resolution
    1600x900
    Hard Drives
    Seagate 1 TB
The OP is asking not only to find a file but a string within that file.
Everything search will also search file contents.
 

My Computers My Computers

  • At a glance

    Win 11 Pro 25H2, Build 26200.8894Intel Core i5 1450064GB DDR4GeForce RTX 4060
    OS
    Win 11 Pro 25H2, Build 26200.8894
    Computer type
    PC/Desktop
    Manufacturer/Model
    Home Brew
    CPU
    Intel Core i5 14500
    Motherboard
    Gigabyte B760M G P WIFI
    Memory
    64GB DDR4
    Graphics Card(s)
    GeForce RTX 4060
    Sound Card
    Chipset Realtek
    Monitor(s) Displays
    LG 45" Ultragear, Acer 24" 1080p
    Screen Resolution
    5120x1440, 1920x1080
    Hard Drives
    Crucial P310 2TB 2280 PCIe Gen4 3D NAND NVMe M.2 SSD (O/S)
    Silicon Power 2TB US75 NVMe PCIe Gen4 M.2 2280 SSD (backup)
    Crucial BX500 2TB 3D NAND (2nd backup)
    Seagate 4TB Ironwolf, rotating HDD archive files
    External off-line backup Drives: 2 NVMe 4TB drives in external enclosures
    PSU
    Thermaltake Toughpower GF3 750W
    Case
    LIAN LI LANCOOL 216 E-ATX PC Case
    Cooling
    Lots of fans!
    Keyboard
    Microsoft Comfort Curve 2000
    Mouse
    Logitech G305
    Internet Speed
    Verizon FiOS 1GB
    Browser
    Firefox
    Antivirus
    Malware Bytes & Windows Defender Security
  • At a glance

    Win 11 Pro 25H2, Build 26200.8894Intel Core i5 1440032GB DDR5Intel 700 Embedded GPU
    Operating System
    Win 11 Pro 25H2, Build 26200.8894
    Computer type
    PC/Desktop
    Manufacturer/Model
    Home Brew
    CPU
    Intel Core i5 14400
    Motherboard
    Gigabyte B760M DS3H AX
    Memory
    32GB DDR5
    Graphics card(s)
    Intel 700 Embedded GPU
    Sound Card
    Realtek Embedded
    Monitor(s) Displays
    27" HP 1080p
    Screen Resolution
    1920x1080
    Hard Drives
    Crucial P310 2TB 2280 PCIe Gen4 eD NAND PCIe SSD
    Samsung EVO 990 2TB NVMe Gen4 SSD
    Samsung 2TB SATA SSD
    PSU
    Thermaltake Smart BM3 650W
    Case
    Okinos Micro ATX Case
    Cooling
    Fans
    Keyboard
    Microsoft Comfort Curve 2000
    Mouse
    Logitech G305
    Internet Speed
    Verizon FiOS 1GB
    Browser
    Firefox
    Antivirus
    Malware Bytes & Windows Defender Security
  • Nimo N171 17" Laptop, (Intel i3-1215U, 16GB RAM, 2TB NVMe, Win11 Pro)
    Acemagic Vista Mini PC V1 (Intel N150, 16GB RAM, 1TB NVMe, Win11 Pro)
    HP ENVY h8-1540t, (24GB RAM, 2TB SSD, 2TB HDD, Win11 Pro)
  • Helpful
Reactions: OAT
Last edited:

My Computers My Computers

  • At a glance

    All Branches but ReleaseAMD Ryzen 7 7735HS 3200-4500 Mhz 8 cores x 232 GB DDR5Radeon Graphic / NVIDIA GeForce RTX 4060 8 GB...
    OS
    All Branches but Release
    Computer type
    Laptop
    Manufacturer/Model
    Acer Nitro ANV15-51
    CPU
    AMD Ryzen 7 7735HS 3200-4500 Mhz 8 cores x 2
    Motherboard
    Sportage_RBH
    Memory
    32 GB DDR5
    Graphics Card(s)
    Radeon Graphic / NVIDIA GeForce RTX 4060 8 GB GDDR6
    Sound Card
    AMD/Realtek(R) Audio
    Monitor(s) Displays
    Integrated Monitor (15.3"vis)
    Screen Resolution
    FHD 1920X1080 16:9 144Hz
    Hard Drives
    KINGSTON OM8SEP4512Q-AA 1TB
    Western Digital 256GB
    PSU
    19V DC 6.32 A 120 W
    Cooling
    Dual Fans
    Mouse
    MS Bluetooth
    Internet Speed
    Fiber 1GB Cox -us & 1GB Orange-fr
    Browser
    Edge Canary- Firefox Nightly-Chrome Dev-Chrome Dev
    Antivirus
    Windows Defender
  • At a glance

    Windows 11 BetaAMD A9-94208 GB of DDR4AMD Radeon R5
    Operating System
    Windows 11 Beta
    Computer type
    Laptop
    Manufacturer/Model
    Asus X751BP
    CPU
    AMD A9-9420
    Memory
    8 GB of DDR4
    Graphics card(s)
    AMD Radeon R5
    Screen Resolution
    1600x900
    Hard Drives
    Seagate 1 TB
Everything search will also search file contents.
But I want to find the string within the file and show that string, all in one step, a .bat file. The purpose of the batch file is to 1) not start another app, 2) find and display the directory where the Ollama models are stored.
 

My Computer My Computer

At a glance

Windows 11AMD Ryzen 5 5600G with Radeon Graphics 6 cores16GBNvideo GeForce RTX 3060
OS
Windows 11
Computer type
PC/Desktop
Manufacturer/Model
HP Omen GT13-1xxx
CPU
AMD Ryzen 5 5600G with Radeon Graphics 6 cores
Memory
16GB
Graphics Card(s)
Nvideo GeForce RTX 3060
Hard Drives
C: SSD, with other hard drives from old PCs.
Back
Top Bottom