bat autostart-up doesnt work correctly under win10

nrdwka

Honorable
Jul 26, 2017
42
5
10,535
Hello,
I have a .bat file running at system startup to create folders in my ramdrive:
XML:
md z:\Temp
md z:\cache
md z:\cache_tb
Recently that bat file stopped to work correctly. Only one thing i done is update my nvidia drivers from 380 to 398.
Now .bat starts, but folders are not created with message: "Subfolder or file already exists"
If i run the same .bat file manually after, folders are successfully created.

I am so confused o.o
 
Why do you need to do this each time? Most ramdisks are designed to save out to disk on shutdown and load from disk on boot.

If there are no files to speak of that are expected to be in these folders.... why not just run rmdir /s /q <dir> (or the powershell equivalent) for those dir names before? Worst case scenario they'll just say it doesn't exist and continue on with the script.
 

nrdwka

Honorable
Jul 26, 2017
42
5
10,535

Thank you.
I intentionally do not save ram disk to ssd as i use it for all temporary data for programs, browser, nvcache, mail client etc. (what windows fail to clean-up automatically, btw). After reboot disk is empty with no folders

i tried to run rmdir before i do md:
XML:
C:\WINDOWS\SysWOW64>rmdir /s /q z:\Temp
The specified file can not be found.

C:\WINDOWS\SysWOW64>rmdir /s /q z:\cache

C:\WINDOWS\SysWOW64>rmdir /s /q z:\cache_tb

C:\WINDOWS\SysWOW64>md z:\Temp
Subfolder or z: \ Temp file already exists.

C:\WINDOWS\SysWOW64>md z:\cache

C:\WINDOWS\SysWOW64>md z:\cache_tb
Z:\ still empty, no folders are created.

Then, i lunch same bat file manually:
XML:
c:\User_soft\Autoload>rmdir /s /q z:\Temp
The specified file can not be found.

c:\User_soft\Autoload>rmdir /s /q z:\cache
The specified file can not be found.

c:\User_soft\Autoload>rmdir /s /q z:\cache_tb
The specified file can not be found.

c:\User_soft\Autoload>md z:\Temp

c:\User_soft\Autoload>md z:\cache

c:\User_soft\Autoload>md z:\cache_tb
And, magically, it's work, folders are created :/

P.S.: i tried to do the same thing using scheduled task with "execute with elevated privileges"flag with no success
 
Is the ramdisk started at the point windows is trying to run the bat?

Because the drive would not necessarily exist yet based on boot order.

Try adding "Timeout /T 30" at the start. It'll delay the bat by 30s, which on an ssd should be more than sufficient to make sure things are started up.
 

TRENDING THREADS