Jump to content

Valerie

Member
  • Posts

    57
  • Joined

  • Last visited

  • Donations

    0.00 USD 
  • Country

    New Zealand

Everything posted by Valerie

  1. Win XP Home. Way back in the good old days some versions of XP did not permit access to Safe Mode without entering an Admin password even if a password had never been set. No password (including leaving the entry blank) would be accepted. The fix was a Reg Edit which stopped Safe Mode asking for any password at all. Unfortunately I cannot remember what the Reg Edit was. Anyone got better powers of recall than mine please? Thanks.
  2. Jaclaz & Wyzöwl. Thank you for continuing with the thread, much is to be learned when members of your standing choose to discuss a topic on open forum. My reason for opting for VBS is to make the script global rather than local, I'm not sure if the return from %time% is fixed globally or can be set locally in some other format. Anyways, the project will be a work-in-progress for some time, am now looking to use the VBS Timer function instead of the Time function. V.
  3. Thank you Yzowl. Here's the script I'm working on and which works as far as my query goes although the results have not yet been proved. @echo off setlocal enabledelayedexpansion cls :: Get the start time :: ------------------ call :GetTime StartHour StartMins StartSecs pause cls :: Get the finish time :: ------------------- call :GetTime StopHour StopMins StopSecs :: Calculate elapsed time :: ---------------------- call :Elapsed %StartHour% %StartMins% %StartSecs% %StopHour% %StopMins% ^ %StopSecs% Hours Minutes Seconds elsecs echo Hours=!hours! Minutes=!minutes! Seconds=!seconds! Elapsed secs=!elsecs! :: Add leading 0 to single digit values (for display purposes only) :: ---------------------------------------------------------------- set cnt=1 :loop set vars=StartHour StartMins StartSecs StopHour StopMins StopSecs for /f "tokens=%cnt%" %%1 in ("%vars%") do ( if !%%1! lss 10 set %%1=0!%%1! set /a cnt+=1 ) if %cnt% LSS 7 goto loop :: Display outcomes :: ---------------- echo.&echo.&echo.&echo.&echo. echo Start time=%StartHour%:%StartMins%:%StartSecs%. echo Stop time=%StopHour%:%StopMins%:%StopSecs%. echo. echo Elapsed seconds=%ElSecs% echo. echo Elapsed time=%Hours% hrs %Minutes% mins %Seconds% secs. exit /b :: Subs :: ---- :GetTime set vbs=%temp%\tmp.vbs ( echo ThisTime=Time echo WScript.Echo Hour(ThisTime^) ^&" "^& ^ Minute(ThisTime^) ^&" "^& ^ Second(ThisTime^) )>%vbs% for /f "tokens=1-3" %%a in ('cscript //nologo %vbs%') do ( set hh=%%a set mm=%%b set ss=%%c ) del %vbs% endlocal&set "%1=%hh%"&set "%2=%mm%"&set "%3=%ss%"&goto :EOF :Elapsed setlocal set /a ElapsedSecs=3600*%4+60*%5+%6-(3600*%1+60*%2+%3) if %ElapsedSecs% LSS 0 set /a ElapsedSecs=%ElapsedSecs%+(24*3600) set /a h=(%ElapsedSecs%/3600) set /a m=(%ElapsedSecs%/60)-60*%h% set /a s=%ElapsedSecs%-60*(%ElapsedSecs%/60) endlocal&set %7=%h%&set %8=%m%&set %9=%s%&set elsecs=%ElapsedSecs%&goto :EOF Note the final line of the :Elapsed sub. If that line is changed to: endlocal&set %7=%h%&set %8=%m%&set %9=%s%&Shift&set %9=%ElapsedSecs%&goto :EOF or endlocal&set %7=%h%&set %8=%m%&set %9=%s% Shift set %9=%ElapsedSecs%&goto :EOF it appears not to return the %ElapsedSecs% content to Elsecs.
  4. Win XP SP.3+ When a sub is Called and more than 9 command line parameters are passed to the sub is it possible to somehow Shift the command line parameters to allow the use of the 10th (and subsequent) parameters? e.g. something like this: Call :SubName %input1% %input2% %input3% %input4% %input5% output1 output2 output3 output4 output5 then as last line of the sub: Endlocal&set %6=%hh%&set %7=%mm%&set %8=%ss%&set %9=%tot%&SHIFT&set %9=%final%&goto :eof Obviously using Shift in that position doesn't work for me, is there another way to shift the parameters please?
  5. Cluberti - Yes, the script runs without error when Cmd /k is used. Thanks to all for your interest and responses. V.
  6. The following script works as expected but I'd like an explanation of why the command CMD /C is necessary for it to run if the drive list contains drive a. This works: @echo off cls setlocal for %%1 in (a b c d e f g h i j k l m n o p q r s t u v w x y z) do ( cmd /c if exist %%1:\ ( fsutil fsinfo drivetype %%1: ) ) This hangs with a "no disk in drive" error message. @echo off cls setlocal for %%1 in (a b c d e f g h i j k l m n o p q r s t u v w x y z) do ( if exist %%1:\ ( fsutil fsinfo drivetype %%1: ) )
  7. Win XP Home. SP3+ I have received a single .rtf file which consists of five concatenated .rtf files, the headers and tails having been deleted after concatenation. I would like to print the file in pages to suit individual files, can I edit the file to insert end-of-page markers then perhaps print using Wordpad? Thanks V.
  8. Windown XP Home SP.3 updated. Above is a quote from this site describing Resident vs Non-Resident data. I don't fully understand what is meant by file characteristics although I take it to mean such things as record length, fixed vs random record length etc. Can someone point me in the right direction please?
  9. Valerie

    NTLDR

    Thank you, I had Googled but obviously not well enough and needed a wakeup call.. V..
  10. Valerie

    NTLDR

    Windows XP Home SP.3+ After Ntldr has established from Boot.ini which install of Windows to boot does Ntldr load the OS using Registry entries or does Ntldr "hand over" control to another routine from Windows\System32 for that routine to load the OS? In other words when does Ntldr's contribution finish?
  11. Thank you. Successfully deleted the Windows installed in C: and installed XP using the install cd. Setup detected the Windows system on D: and created the correct Boot.ini.
  12. Situation: Vista installed on C: partition, Win XP on D: Is it possible to boot to D: and format C: then install a later version of XP on C: and retain multibooting capability by editing Boot.ini or by some other means? Unfortunately it's not known which OS, Vista or XP, was installed first.
  13. Home edition SP.3+ Is it possible to alter settings in an installed system by using a live cd or other method(s) to access the installed system? Example: If a system blue screens at startup when the "Automatically Restart" box is checked can that setting be altered (unchecked) using a live cd or perhaps slaving the system drive and accessing on another pc? Thanks.
  14. Thanks Jaclaz. I don't have a script yet as couldn't find info on how to use null as a delimiter. I'm trying to get drive letter assignments into variables using Fsutil as shown: ←C:\>fsutil fsinfo drives Drives: A:\ C:\ D:\ E:\ F:\ G:\ ←C:\> Seems to me that the delimiter in the above is a space but when tried using a For loop like: │@echo off │cls │ │setlocal enabledelayedexpansion │ │For /f "tokens=1-6 delims= " %%A in ('fsutil fsinfo drives') do ( │ set one=%%B │ set two=%%C │ set tre=%%D │ set for=%%E │ set fiv=%%F │) │echo One = !one! Two = !two! Three = !tre! Four = !for! Five = !fiv! │ only A:\ was returned. So had a look at the Fsutil output in a hex editor with the result: It now seems that the delimiter is null (hex 00) hence my query. Any advice appreciated. V.
  15. Win XP Home, SP.3 Cmd.exe batch scripting. Can Null (hex 00) be used as a delimiter in a For loop? Thanks.
  16. Thank you Wise One, your advice and comments are appreciated. I hadn't included my entire script, enabledelayedexpansion is achieved using the /v:on switch when cmd.exe is invoked and the script is run from an exclusive .bat directory, pushd is used to access the "default" directory containing files. Again, many thanks. V.
  17. Win XP Home SP.3 Using CMD.exe scripting. 1. If I want to rename a lot of files in the default directory by deleting the first three characters of each name I can use: For /f "delims=*" %%A in ('dir /b') do ( set name=%%A ren "%%A" "!name:~3!" ) Can the intended result be achieved without using Set so that the code might look something like: for /f etc.... ren "%%A" "!%%A:~3!" ) Is it possible to change the content of %%A in this or a similar manner? I've tried various command syntaxes without success. 2. Can batch scripting command(s) be used to edit a binary file? All I've managed to do is amend the hex display of the binary but have been unable to write the binary change to disk. Example: A binary contains one byte 11111111 (decimal 255) which is displayed as hex FF which is to be changed to 11111110 (245) FE Resolved... Thanks.
  18. Win XP Home SP.3 Is there any way of associating an Application with a Process in Windows Task Manager? I want to be able to check for a running batch script but Tasklist and a third-party utility (PV.exe) only list processes and the Process entry for my batch script is CMD.EXE (see attachments) so the Application and Process entries are different and if two batch scripts are running both entries in the Process list are CMD.EXE Thanks
  19. XP Pro. I'm trying to run scheduled batch scripts but there is no display output as there is when I run them from within the Cmd.exe window. The scripts are running and creating disk file output as normal, just no display. The same happens with other programs such as the XP Tour, Task Manager shows they are running but no display output from them either. Is there any way of getting scheduled tasks to output to the monitor? Thanks.
  20. Valerie

    Defrag MFT

    To answer your questions: 1. I am using the M$ utility NFI.EXE to display MFT info. 2. I have no specific problems with my PC, this started out as a quest for information on the MFT as to what size of file would remain $Data (resident) i.e. be stored in the MFT instead of at another location on the hdd. I had read that the max file size was approx 1500 bytes but this has turned out, in my case, to be slightly less than 700 bytes. 3. I am not getting into overkill with maintenance. I have run Diskeeper manually and it appears to have made no difference to the $MFT or other metadata files, but did give appreciable improvements in defragging some data files. An example is shown below, but it did not defrag all data files. Perhaps Defrag and Diskeeper are denied access to some files, I'm beginning to doubt that either are permitted access to the metadata files ($MFT etc). Again, I'm not 100% certain that I'm interpreting the displayed info correctly.
  21. Valerie

    Defrag MFT

    XP Home. Following multiple defrags the Master File Table still seems to be fragmented as below. Is this normal or am I interpreting the information incorrectly. Thanks.
  22. Win XP Home SP.3. I know what causes fragmentation and that a Defrag utility will, to a great extent, sort it out but I don't know how Defrag works. Does Defrag read file fragments into ram then write them back to disk contiguously? What will happen if a fragmented file is read but there isn't a contiguous area on disk to which the file can be written, is the newly written file then fragmented? I assume that the areas used by file fragments will not be made available for re-use until the new defragmented file is written so a reasonable percentage of free disk space must be available to Defrag, what would that percentage of total disk space be, or is that reliant on the size of the Used disk space?? Thanks - I have searched for info and found lots on what causes fragmentation but very little on how Defrag achieves defragmentation. V.
  23. Win XP Home, Gateway W3107, AMD Sempron 3100+, 512mb ram. The pc has slowed considerably, been checked for malware & clean as a whistle. Runs AVG with Comodo and Spywareblaster. Whenever an attempt is made to open a desktop folder the error message displayed is "Windows Explorer has encountered a problem and needs to close...". The condition arose about 2 weeks ago but the user has no idea when SP.3 was installed, presumably during Win updates. If the decision is made to uninstall SP.3 are there likely to be disastrous consequences, no hardware or software has been added. The user does not have an XP install disk of any kind. Thanks V.
×
×
  • Create New...