Content Type
Profiles
Forums
Events
Everything posted by Yzöwl
-
Binary Data Compare Batch - [fc]
Yzöwl replied to AceInfinity's topic in Programming (C++, Delphi, VB/VBS, CMD/batch, etc.)
Taking the scenarios above, could you explain how I would do this using your script as posted and improved upon thus far.Which files would I select in, for instance, system32 together with my suspect system32 file in order to start a comparison? Now why would you do that in perl and not in the batch script? Based on the method you are using and the potential time it takes and, as jaclaz above states, the possibly huge output file to check that is exactly the kind of thing I'm expecting you to think about. I know that's a decision you could make yourself manually when selecting the files in your explorer window, but why accept manually when you're creating a script to save time. -
Binary Data Compare Batch - [fc]
Yzöwl replied to AceInfinity's topic in Programming (C++, Delphi, VB/VBS, CMD/batch, etc.)
You still don't get it AceInfinity, I provided advice, Scr1ptW1zard did the job for you and jaclaz improved on Scr1ptW1zard's work. My questions weren't whether you could do something they were designed to lead you to the reasons why you posted the script and what your end users would use it for. You haven't answered it, and TBH examining the scenarios whereby the file becomes useful to others is the most important thing about posting it. What did you need it for? are many others likely to be in the same or similar situation? how would their situation differ? Are many people likely to have a single directory containing many files which may be identical in all but name and, if so, why would they want to know and what would they do with them etc.? Take a look at the output file you get and see if there is anything in it which could be bettered for the end user, how would you change the code to do that? Is the end user likely to need to know the differences or just whether or not there were any? Without answering these, the only real part of the script which becomes useful to us is the portion produced by Scr1ptW1zard and improved on by jaclaz. -
Binary Data Compare Batch - [fc]
Yzöwl replied to AceInfinity's topic in Programming (C++, Delphi, VB/VBS, CMD/batch, etc.)
You are too kind Scr1ptW1zard, jaclaz. As end users we really need to ask ourselves why we want to run this file. What are we looking for from it? Are we trying to find identical files, or are we trying to find files which appear the same but aren't? What are the likely scenarios under which this type of comparison would be required? -
Binary Data Compare Batch - [fc]
Yzöwl replied to AceInfinity's topic in Programming (C++, Delphi, VB/VBS, CMD/batch, etc.)
You didn't ask for help you didn't ask changes, you asked for feedback! Here's what I've already done for you: Informed you that there was a discrepancy in the date you'd written in the script compared with that in which you'd stated you had written it. Informed you that the main method you said you'd used wasn't in fact used at all. Informed you that you could simplify a specific portion of your code. Informed all readers what would happen if they ran your script thus prompting the author explanation it required. Informed you that there are other ways of performing the task when faced with similar problems. If your file works for you in your situation, and you're happy enough to post it on a public forum for others to use, then be pleased that you've done your best with it. If I were your maths teacher I'd say that for your specific problem you got the question right. I'd then suggest that you investigate different theories or formulas to improve its efficiency and satisfy a greater diversity of working situations. I certainly wouldn't do it for you! Please don't allow any inferiority frustration you feel to propagate further argumentative responses. -
Binary Data Compare Batch - [fc]
Yzöwl replied to AceInfinity's topic in Programming (C++, Delphi, VB/VBS, CMD/batch, etc.)
BTW, you didn't tell me anything I didn't already know, I only mentioned the parameter allocation and how the file works because you hadn't. (It's a little pointless posting a file for others to use if they don't know what to do or what it does.) Your method of determining whether any arguments were input still seems a little convoluted. I'm not just good I'm excellent. Why would there be tension, you asked for feedback, and I gave some! TBH if I were to ever come across a similar kind of problem I would be unlikely to use FC anyhow. -
Binary Data Compare Batch - [fc]
Yzöwl replied to AceInfinity's topic in Programming (C++, Delphi, VB/VBS, CMD/batch, etc.)
Some general observations: You say you created the file some months ago, but strangely it was copyrighted only this month! You say that you have used 'SHIFT' in order to allow for more than nine arguments, but 'SHIFT' appears to not exist within the code. Your method of determining whether any arguments were input seems a little convoluted. You didn't explain in enough detail what the purpose of the script was: It compares one file which when dropped with a bunch of others onto a batch file is allocated as the first parameter, (using luck), with every other file following it. i.e. compare 1 with 2, 1 with 3, 1 with 4 etc. -
SET will not set a variable beyond the current session so you cannot simply set a variable which can be used in future command sessions. Each line you create under GUIRunOnce will be a different command session. If you wish to work directly from GUIRunOnce, you'd have to do it all in one single line of commands concatenated as required.
-
If all of the updates are located within the same directory as the batch file then you don't need the recursion and can indeed navigate to the source directory. @ECHO OFF SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION PUSHD %~dp0 FOR %%A IN (*-KB*.MSU) DO ( CALL :SUB %%~nA ECHO= Installing KB!KB_NUM! >NUL TIMEOUT /t 3 WUSA "%%~fA" /quiet /norestart) ECHO= == Press any key to restart == >NUL PAUSE SHUTDOWN.EXE /r /t 0 GOTO :EOF :SUB SET "KB_NUM=%*" FOR /F "DELIMS=-" %%B IN ("%KB_NUM:*-KB=%") DO SET "KB_NUM=%%B"
-
SP3 from Microsoft and SATA driver from ASUS or VIA, tutorials and posts are available on this site for the methods used to incorporate them.
-
Malwarebytes Blocking malicious IP address!
Yzöwl replied to lapetite66's topic in Malware Prevention and Security
Here's the data on the IP Address -
…as long as you're prepared to receive odd answers! Welcome to MSFN.
-
*Solved* New Virus Impossible to Remove HELP
Yzöwl replied to 1212magicman's topic in Malware Prevention and Security
Your problem then is that you have a file name containing a character, :, which is not allowed in an NTFS file name. There are some utilities available for dealing with such files but you may be lucky using the following in a command prompt window: del /a /f "\\?\D:\\Documents and Settings\User\Local Settings\*.exe" BTW there should be a directory named Temp in that location unless you have purposely redirected it to a non standard location yourself. -
batch command help
Yzöwl replied to balanel's topic in Programming (C++, Delphi, VB/VBS, CMD/batch, etc.)
Please remember that there is a more simple method too: @FOR %%# IN (*_*.BAT) DO @(CALL "%%#")I posted the former because as a for loop 'command' rather than 'file set' you have more control over the variables, (and they're easier to maintain), simply by changing the contents of the loop or the tokens/delimiters rather than parsing through resulting variables with extra code later. -
batch command help
Yzöwl replied to balanel's topic in Programming (C++, Delphi, VB/VBS, CMD/batch, etc.)
@FOR /F "TOKENS=*" %%# IN ('DIR/B/A-D *_*.BAT') DO @(CALL "%%#") -
I'm fairly certain that a regular user can only read from "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" so you'd certainly need to be elevated to write to it in a regular session.
-
Try this to see how it works: @ECHO OFF CHOICE /C YN /M "PLEASE MAKE YOUR CHOICE" IF %ERRORLEVEL%==2 ( ECHO. ECHO YOU SELECTED [N] ) IF %ERRORLEVEL%==1 ( ECHO. ECHO YOU SELECTED [Y] ) ECHO. PAUSE
-
Choice made a return in Windows 7;
-
%ERRORLEVEL%
-
Redirect 7z Output to a Directory
Yzöwl replied to Andrews's topic in Programming (C++, Delphi, VB/VBS, CMD/batch, etc.)
I thought that they had the following: SourceDir \SubFolder \ChildDir1 File789.ext Filexyz.ext File1.ext File2.ext File3.ext \SecondSub \ChildFolder File123.ext Fileabc.ext File7.ext File8.ext File9.ext ThisScript.cmdWhen they execute ThisScript.cmd they wish it to produce two 7z files, (in a folder named 'Compressed' on the Desktop), %UserProfile%\Desktop\Compressed\SubFolder\SubFolder.7z and %UserProfile%\Desktop\Compressed\SecondSub\SecondSub.7z. However I see little point in recreating the top level structure since 7-zip will compress the directories SubFolder and SecondSub not just their contents. I would probably suggest something like this, (untested): @ECHO OFF &SETLOCAL ENABLEEXTENSIONS DISABLEDELAYEDEXPANSION (SET COMPDIR=%USERPROFILE%\DESKTOP\Compressed) FOR %%# IN (%COMPDIR%) DO (SET _=%%~dp#) IF /I "%_%"=="%~dp0" GOTO :EOF (SET UTILDIR=%PROGRAMFILES%\7-ZIP) IF /I NOT "%CD%\"=="%~dp0" PUSHD %~dp0 FOR /D %%# IN (*) DO ( IF NOT EXIST "%COMPDIR%" MD "%COMPDIR%" "%UTILDIR%\7Z.EXE" A -T7Z "%COMPDIR%\%%#.7z" "%%#" )You should be able to add the integrity verification command line to the above as required. -
Redirect 7z Output to a Directory
Yzöwl replied to Andrews's topic in Programming (C++, Delphi, VB/VBS, CMD/batch, etc.)
The only logical way of doing this without potentially deleting something which failed to be added to a working compressed archive is: Compress Directory Contents to Archive (in a temporary location) If successful Test Archive integrity If successful Extract Archive (to another temporary location) If successful Compare extracted files with originals If successful Delete originals and temporary ones Move archive to Original Directory -
The comand you are using is incorrect, have you typed in START /? at the command prompt to understand the switch you have used? FOR %%A IN (E F G H I) DO ( IF EXIST "%%A:\hehe\AllZIPS\PRet.bat" (START "" /WAIT "%%A:\hehe\AllZIPS\PRet.bat") )
-
Script/Cmd , Freespace
Yzöwl replied to Sonic's topic in Programming (C++, Delphi, VB/VBS, CMD/batch, etc.)
Have you tried that, I was sure that my previous venture into using a similar method failed because the number of bytes is too large for the GTR / LSS to be able to solve. Try breaking the figures down into its smaller components. Here's a 200Gb example for drive C: @ECHO OFF &SETLOCAL ENABLEEXTENSIONS FOR /F "TOKENS=3" %%# IN ('DIR C: /-P 2^>NUL') DO SET "SIZE=%%#" FOR /F "TOKENS=1-4 DELIMS=," %%a IN ("%SIZE%") DO (IF "%%d"=="" (GOTO LO) SET "gb=%%a" &SET "mb=%%b" &SET "kb=%%c" &SET "by=%%d") IF %gb%%mb% LSS 214748 (GOTO LO) IF %gb%%mb% EQU 214748 (IF %kb%%by% LEQ 364800 (GOTO LO)) GOTO HI :LO ECHO=Drive has insufficient free space PAUSE &GOTO :EOF :HI ECHO=Drive has sufficient free space PAUSE -
util or shell extension to have dockable cmd bar in XP?
Yzöwl replied to Leeoniya's topic in Windows XP
What about a widget for the sidebar, (Vista+), even if you don't have Vista yet there's a standalone version you may be able to use.