| 1. |
Solve : %appdata% use within batch help? |
|
Answer» I made a batch earlier today to clean my IMVU http game cache that grows over time with no built in size management, and as it grows it starts to lag out performance as at one point it was filled with 5.3GB of cache mostly junk gathered throughout gameplay which appears to act like a precache for the game. However when you end up with over 100,000 of these small files the performance benefit of these files being local disappears. I made a copy of IMVU before and after so I could restore the 5.3GB of cache data back and it LOADS rooms etc more than twice as fast by not seeking the data locally but instead redownloading it off the IMVU servers over 25/5 mbps broadband. The batch I made for this specific COMPUTER I just gave it the full path of c:\Users\AX4\AppData\Roaming\IMVU\ and told it to remove the HttpCache directory and all contents silently. Then recreate an empty directory back at that location for the IMVU client to write to when the game is run again. The filename, directory name, or volume label syntax is incorrect. Note: The pause after the rd /s /q HttpCache is only here for debugging and WOULD be removed later. I placed it there to capture the error condition. echo off color 4f cls @echo. @echo. *************************** @echo. IMVU Http Cache Eraser @echo. *************************** @echo. Version 1.0 @echo. 6/1/2016 @echo. pause color e0 cls cd c:\%AppData%\Roaming\IMVU\ @echo. @echo. @echo. *************************** @echo. Erasing IMVU Http Cache @echo. Please Wait... @echo. *************************** @echo. @echo. rd /s /q HttpCache pause md HttpCache color 3f cls @echo. ************************** @echo. IMVU Http Cache Erased @echo. ************************** @echo. @echo. pauseThe expansion of the %appdata% environment variable already contains the system drive letter, colon and backslash e.g. C:\ at the beginning so you don't need it like in the code line following. It will make the CD command point to a non-existent folder and give the error you saw. cd c:\%AppData%\Roaming\IMVU\ Thanks Salmon for assisting... But its still not happy. Using Windows 7 Home Premium 64-bit by the way just in case that make a difference somehow. I tried cd %AppData%\Roaming\IMVU\ cd \%AppData%\Roaming\IMVU\ cd C:\%AppData%\Roaming\IMVU\ And the path is correct to this folder at the deeper target of Roaming\IMVU\ Changed it to cd %AppData%\Roaming\IMVU\ as suggested and it says path not found. Quote The system cannot find the path specified. Here is my system paths from SET: Quote Microsoft Windows [Version 6.1.7601] [attachment deleted by admin to conserve space]Environment variable may not expand %APPDATA% to the Application folder https://support.microsoft.com/en-us/kb/329308 Quote This behavior is caused by a problem in Shell32.dll.Hello Geek ... it looks like that bug is in reference to: Quote Article ID: 329308 - Last Review: 02/28/2007 23:02:00 - Revision: 2.3 And I'm running Windows 7 64-bit I didnt catch this fact that it was for different OS until I went to the suggested fix and there was no Properties option and I was like hmmm why is it missing and then I looked further and saw that it was regarding other affected OS's. Quote APPDATA=C:\Users\AX4\AppData\RoamingQuote Changed it to cd %AppData%\Roaming\IMVU\ as suggested and it says path not found. That expands to C:\Users\AX4\AppData\Roaming\Roaming\IMVU\ . You want Code: [Select]%APPDATA%\IMVUCOOL! Thanks BC That was the fix! Thanks everyone. I thought it would only bring you in to the AppData depth of the path. Did not know that any subfolders could be targeted without exclusive pathing. I thought the path had to be exclusive to be specific to Roaming prior to IMVU. Correction to my last response Quote Did not know that any subfolders could be targeted without exclusive pathing. I thought the path had to be exclusive to be specific to Roaming prior to IMVU. I realized I was wrong in my statement. Looking back here I see that %AppData% pointed direct to the Roaming folder of the profile Quote APPDATA=C:\Users\AX4\AppData\Roaming The path is specific as seen in SET The fix to batch worked perfect, so issue is solved, but in case anyone ever gets here and reads the entire thread, they will see this correction.Windows XP SP3 C:\Documents and Settings\username\Application Data Windows 7 SP2 C:\Users\username\AppData\Roaming Windows 10 C:\Users\username\AppData\Roaming Usernames can have spaces and other nasties, so wrap it in double quotes to protect against that. Code: [Select]"%APPDATA%\IMVU"Cool Thanks Foxidrive ... I overlooked that. The good thing is that my friends computers who also run IMVU dont have spaces so the original form worked like a charm, but its good to state it here to fix that line to include the " " in case someone else runs with the batch to use as their own that finds this online. |
|