82512

Can't found the variable with number

Question:

echo off SETLOCAL EnableDelayedExpansion set caminho="C:\Users\%username%\AppData\Local\Microsoft\Outlook" set maxbytesize=10 for /F %%i in ('dir /b "C:\Users\%username%\AppData\Local\Microsoft\Outlook\*.ost"') do ( set directoria=%caminho%\%%i %1 %0 :: %directoria% set len=%~z2 if %len% LSS %maxbytesize% ( msg * algo PAUSE ) ELSE ( msg * O ficheiro exedeu 29Gb, diriga-se a Informatica ) )

Im not so good in this so i need some help. I have a similar code that works, but when i "transform" into this it starts to say that 10 is not expected being 10 the %maxbytesize%. There some way to make this work or i need to start all over again??

Answer1:

None of those variables need setting because they are not used outside of the code or manipulated within the code:

<pre class="lang-bat prettyprint-override">@Echo Off Rem If "%~1"=="" Exit/B Set "MaxByteSize=31138512896" For %%A In ("%LocalAppData%\Microsoft\Outlook\*.ost") Do ( Rem "%~1" "%~f0" :: "%%~fA" If %%~zA Lss %MaxByteSize% (msg * algo) Else ( msg * O ficheiro exedeu 29Gb, diriga-se a Informatica))

If you really are running the script with a single argument then remove both instances of <strong>Rem</strong>.

Recommend

  • When writing file 3 lines are deleted, and should not
  • Custom Dropdown Menu
  • Separate IP from text in ping output?
  • Consuming web service using wsdl in Domino
  • Is there a correct way to parse output in Bash from a command?
  • Load unistall icon from exe file in the inno setup
  • Apache POI blank values
  • Plotting A Hyperboloid
  • How can I count unique terms in a plaintext file case-insensitively?
  • Consuming a web service with the Netbeans Platform
  • Programmatically Update Linked Named Range of excel object in MS Word (2007)
  • end daemon processes with multiprocessing module
  • Layout design help Android
  • insert a picture into database(sqlite) with java code. what should i do?
  • TSQL Rolling Average of Time Groupings
  • How do I check if System::Collections:ArrayList is empty / nullptr / null?
  • Draw half infinite lines?
  • Better Indy for Dephi 2007
  • Sesame : how to remove the inference during queries?
  • Compare struct to a constant in C
  • converter json to two dimensional array
  • WPF version of .ScaleControl?
  • Javascript, Regex - I need to grab each section of a string contained in brackets
  • Pass Dictionary to Javascript array
  • How to make JSON.NET deserialize to Microsoft Date Time?
  • Differences in dis-assembled C code of GCC and Borland?
  • Marklogic : Query response time is very high
  • Remove final comma from string in vb.net
  • Caching attributes in superclass
  • print() is showing quotation marks in results
  • copying resource to sdcard gives a damaged file in android
  • Android full screen on only one activity?
  • Different response to non-authenticated users and AJAX calls
  • jQuery show() function is not executed in Safari if submit handler returns true
  • C# - Serializing and deserializing static member
  • Resize panoramic image to fixed size
  • Incrementing object id automatically JS constructor (static method and variable)
  • Weird JavaScript statement, what does it mean?
  • Do create extension work in single-user mode in postgres?
  • 0x202A in filename: Why?