Jump to content

jaclaz

Member
  • Posts

    21,294
  • Joined

  • Last visited

  • Days Won

    53
  • Donations

    0.00 USD 
  • Country

    Italy

Everything posted by jaclaz

  1. The tool I normally use to create a 00's file is fsz (part of the dsfok toolkit), but still it uses bytes as argument. Technically you can even use a loop in plain batch, using the powers of 2 (as long as you want sizes that are multiples), but since you need anyway a third party utility (mke2fs), you could use a file creating one that accepts suffixes like K, M or G. Here: http://www.henrynestler.com/colinux/tools/ http://www.henrynestler.com/colinux/tools/file-utils-mingw-bin-stripped.zip meet mkfile.exe : C:\appoggio\Filetests>mkfileUsage: mkfile [-s] [-r] [-k] [-m] [-g] filename filesizewhere filename is the name of the file to createfilesize if the size of the file.-s means create a sparse file ( only supported on ntfs 5 or greater )-r means resize an existing file-k -m -g means the size is in KB, MB, or GBjaclaz
  2. And, unless you go for the "special" SELFIE edition you also save a lot on screen cleaning products . jaclaz
  3. There is a limit (actually more than one) in batch math. Besides the fact that only integers are accepted, there is a limit which is 0x7FFFFFFF, i.e. 2,147,483,647. Numbers bigger than that are NEGATIVE numbers, i.e.: SET /A max=0x80000000 will output: -2147483648 and SET /A max=0xFFFFFFFF will output: -1 But if you want a file exactly 1 Gb (a "real" one, what to be "politically correct" we should call a Gib), i.e. 1024x1024x1024=1,073,741,824 There should be no problem. Otherwise you will need a trick or two (or more). Check my multiply.cmd: http://reboot.pro/topic/2986-yacbfc-dec2hexcmd-and-hex2deccmd/ The file you create with fsutil is not actually "blank", it is filled of 00's: https://technet.microsoft.com/en-us/library/cc788058.aspx Then, in order to have an EXT2 filesystem applied to it you need a tool capable of formatting a file with that filesystem or capable to format a volume once you have mounted it in a virtual disk driver. The Ext2dfsd project: https://sourceforge.net/projects/ext2fsd/ does contain a mkefs2.exe, a Windows port of the mke2fs Linux utility (through Cygwin), which may (or may not) do what you need. mke2fs is not exactly a tool with a "friendly" syntax, but usually it auto-calculates all parameters, so that something *like*: set CYGWIN=nodosfilewarningmke2fs.exe <full path to the image file>set CYGWIN=should work jaclaz
  4. If required is Windows XP you could use a PE 1.x (like a BartPE or the one or the other versions of LiveXP) or one or the other versions of minimal XP builds. Also, with only 1 Gb of RAM you'd better use a "flat" PE (cannot say if recent PE's can be made "flat", PE 1's and 2's and I seem to remember 3's could). jaclaz
  5. Krebs on Foscam: http://krebsonsecurity.com/2016/02/this-is-why-people-fear-the-internet-of-things/ jaclaz
  6. Of course it is just a joke to show an example of zeroless pandigitals: http://www.worldofnumbers.com/ninedig1.htm Sure , that is a "normal" way, but findstr in some cases is extremely slow, and that way the user might input a "special" character like '"%&!()<>| that may make the batch fail, actually it should be: FOR /F "delims=123456789" %%? IN ("!chosen!") DO ... to take advantage of delayed expansion, see: http://www.robvanderwoude.com/battech_inputvalidation_setp.php About Mountvol, if I recall correctly, it is "self-standing", i.e. just adding mountvol.exe to the liveXP build it should work. jaclaz
  7. And from the outside, this could even be counterproductive. The more people provide ways (like ClassicShell, Aeroglass, various tweaks, service disabling, etc.) that allow people to make their Windows 10 if not good at least bearable, the less the good MS guys will have a reason to do something to better it. I mean, let us assume that out of 100 Windows 10 users: 1 actually - and in good faith - likes it 9 are MS fanboys and will like whatever the MS good guys release 5 know enough to tweak it into a bearable (almost) experience and they actually tweak it 13 know enough to tweak it into a bearable (almost) experience but they cannot actually tweak it (corporate policies and what not) 25 don't know enough to experiment and make tweaks by themselves but can use the already made programs or follow the available instructions 20 don't bother to tweak it 27 do understand how bad the abomination is and hate it but are not expert enough to tweak it or to use another OS (for whatever reason) MS could legitimately say that 1+9+5+13+25+20=73 people out of 100 are using the OS in a satisfactorily manner. Without the nice tools and tweaks, that amount would be at least 25 less. jaclaz
  8. Yep, and this is (yet another) can of worms , AFAIK/AFAICR with SATA (and UEFI) a number of motherboards do not always assign disk numbers in the "same" order. jaclaz
  9. Only to show off a little bit and to have an occasion to use some math in the batch , how I would write the stuff: @ECHO OFFSETLOCAL ENABLEDELAYEDEXPANSIONSET lookfor=ToolsforPE.ISOSET /A Counter=0FOR /F %%A in ('MOUNTVOL^|FIND ":\"') do (dir /b %%A%lookfor% >nul 2>&1 && (SET /A Counter+=1set isofile[!Counter!]=%%A%lookfor%))SET /A §=0x9EA*2538+0x44F1*17649IF NOT DEFINED isofile[1] ECHO NO iso file was found&GOTO :endECHO Found !counter! item(s):FOR /F "tokens=2,3 delims=[]=" %%A IN ('SET isofile') DO ECHO %%A - %%BIF !counter!.==1. SET chosen=1&GOTO :past_choice:choice_loopSET /P chosen=Please choose item number:FOR /F "delims=%§%" %%? IN ("%chosen%") DO ECHO Invalid input&GOTO :choice_loopIF %chosen% GTR %Counter% ECHO Invalid input&GOTO :choice_loop:past_choiceECHO You chose item #%chosen% which is isofile[%chosen%] i.e. !isofile[%chosen%]!:endECHO.ECHO End of batchjaclaz
  10. I will try again. The data in the "Info" column in diskpart DOES NOT EXIST , it is generated dynamically. You can have n disks each with a FAT32 EFIsys partition, but only one partition on one disk will have the "System" tag in diskpart, the one that was actually used for booting the running system or, if you booted (say) a PE of some kind, NONE of them will have that tag. Each of the FAT32 EFIsys partition on each of the n disks may instead have a "SYSTEM" label, which UNLIKE the "Info" is a "static" value. So, looking for the "System" tag in "Info" can return one or no result, while looking for "SYSTEM" in "Label" may return more than one result. I hope now the point is more clear. jaclaz
  11. Today is Nissan's turn (though for a rather scarcely relevant/preoccupying) issue: http://www.bbc.co.uk/news/technology-35642749 http://www.troyhunt.com/2016/02/controlling-vehicle-features-of-nissan.html jaclaz
  12. Hey, someone seemingly liked the idea of using the accented o (ò) to trick the board parser . I would add that this: [quòte name=Sophy" timestamp="1456285606] Could someone tell me how to use [/quòte] will result in the one with the "post=" will add an (again not understandable) couple of clouds on the right of the quote that when clicked upon will bring up the original post (this is very handy when a quoted post is on a previous page or on another thread. jaclaz
  13. Please note that I am saying something slightly different. If you have one disk (GPT) with a UEFI Windows installed on the default EFIsys type partition, if you run the command from that booted OS (the one that was booted from that disk) then you will have the "System" in "Info". If you boot a PE from (say) CD/DVD, there won't be a "System" in "Info" (and then the label of "SYSTEM" might be of use). But if you have two disks, each with a EFIsys partition you will have a problem as two volumes with FAT32 in Fs and with EITHER "SYSTEM" as label OR "System" in "Info" will be found and listed. And BOTH will have a \EFI\Boot\microsoft\bcd in them. So you may need to LIST DISKs, and then DETAIL each of them. jaclaz
  14. I don't get the issue (if any) with setting counter=1 Here this: SET /A Counter=1for %%b in (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 (dir %%b:\ToolsforPE.ISO >nul 2>nul && (set isofile[!Counter!]=%%b:\ToolsforPE.ISO&&SET /A Counter+=1))set isofile[1]set counterIF NOT DEFINED isofile[1] echo ISO not foundresults in isofile[1] NOT DEFINED if the iso has not been found. What is the problem? If you want to set initially Counter to 0 (or to 42) is good as well, as long as you make the check for isofile[0] or for isofile[42]. jaclaz
  15. This is why you should (if you want to tinker with your system) to study a bit of the basics. A Windows bootmanager BOOTMGR or its UEFI counterpart bootmgfw.efi is normally "backwards compatible" but cannot (rather obviously) be "forward compatible". I.e. the Windows 8.1 bootmanager can boot the Windows 7 besides the 8.1, but the windows 7 bootmanager cannot boot 8.1. So definitely you need to use the Windows 8.1 bootmanager to load the Windows 7's. It is very possible, for *any* reason that the EasyBCD did not add those Windows 7 entries correctly and/or that some settings for the BCD are "wrong" (i.e. do not allow booting the Windows 7). I have no idea what is iReboot, but I tend to avoid anything that is named with a small i as initial . You may want to report the problem to the manufacturer's forum: https://neosmart.net/forums/ or take the plunge and get familiar with the BCDedit tool, this would be a good place to start: http://www.mistyrebootfiles.altervista.org/documents/BCDEdit/index.html Or you could try this other tool : https://www.boyans.net/ JFYI there is (maybe was) an ongoing flamewar between the Authors of the two tools and I am not endorsing in any way - not even indirectly - the one or the other . jaclaz
  16. Well, no. You need to study a minimal of the environment and of the batch syntax. PATH is a "special" variable in Windows (and in DOS for this matters). And you are not really "new" to batch, it's like two years that you are a member of MSFN and try writing small batches. It seems like you take one snippet here (and one there) than modify them in a "random" or "semi-random" way and as soon as they don't work you ask for help here and as soon as you get an EXAMPLE, instead of studying it and trying to understand why it works (or why it doesn't work) you further modify it in a random or semi-random way, and this leads to another loop. Try using "mypath" or "isopath" instead of "path" in that batch. jaclaz
  17. As often happens, yes and no. It is IF seen from the booted OS from that disk. The "System" or "Boot" in the "Info" column are not a "fixed" attribute, if you boot another OS (from another media/device) that volume will be a volume like any other one with no such attribute. Looking for cAsE UnSeNsItIve string "System" might work in your case because also the volume label is "SYSTEM", but cannot say if this is a (recent) Windows "standard", in any case, if you have more that one disk with independent Windows installs this latter "feature" may be unwanted. jaclaz
  18. The feature is in practice unavailable if you use reply "normally", you need to switch into BBcode, i.e. press the button that looks totally NOT understandable, similar to a paper clip (first on the left on the toolbar when replying) that button toggles bbcode on and off. If you click on it, the above Quote of your post will look similar to this: [quòte name=Sophy" post="1118787" timestamp="1456285606] Could someone tell me how to use the Multiquot and Quote options if there is a long post and I only want to quote and reply to certain parts of it? [/quòte] so you can copy and paste the tag before and after the parts, getting something *like*: [quòte name=Sophy" post="1118787" timestamp="1456285606] Could someone tell me how to use [/quòte] Yes ;yes;. [quòte name=Sophy" post="1118787" timestamp="1456285606] the Multiquot and Quote options if there is a long post [/quòte] It is easy, once you know how to do it. [quòte name=Sophy" post="1118787" timestamp="1456285606] and I only want to quote and reply to certain parts of it? [/quòte] Sure, that is the correct approach. ;thumbup Which will result in: Yes . It is easy, once you know how to do it. Sure, that is the correct approach. jaclaz
  19. This should work then: Maybe it is another issue with copy/paste through the board? , it should "filter" the only line with both "FAT32" and "System" in it. Try separating the issues: ECHO list volume|Diskpart>result.txt TYPE result.txt|FIND "FAT32" TYPE result.txt|FIND /I "System" TYPE result.txt|FIND "FAT32"|FIND /I "System" jaclaz
  20. You need to use ENABLEDELAYEDEXPANSION to resolve variables like !CDROM!, you have already been told this, and you have been ALREADY told to READ here: http://www.robvanderwoude.com/variableexpansion.php you need to study and understand the syntax of batch files, Delayed Expansion is something that you must become familiar with. Then strip them, the idea is that you are given some examples, they are intended to be used as a way to learn batch syntax, not that of writing the batch for you, not even snippet by snippet. However, what do you think would be the effect of: SET cdletter=%cdletter:\=% How will the value of cdletter be affected? Sometimes copy and paste (it depends on the browser, the board software, etc.) may transform Tabulators in spaces, the delims in: "tokens=3,5 delims=\ " are intended to be \ (backslash) and Tabulator (not space). jaclaz
  21. Sure, it is not EXACTLY what you want, but it does show you an EXAMPLE on how to parse the diskpart list volume. An EXAMPLE is something that you need to ADAPT to your needs. In this specific case, the diskpart command is a single one, so a simpler pipe should do: Try on your system running this and post the output: FOR /F "tokens=* delims= " %%A IN ('ECHO list volume^|diskpart^|FIND /I "efisys"') DO ECHO %%AI havent' handy a winows 7 or later system with a EFI/GPT disk to check the output of diskpart, this might also do: FOR /F "tokens=* delims= " %%A IN ('ECHO list volume^|diskpart^|FIND "FAT32"^|FIND /I "System"') DO ECHO %%Ajaclaz
  22. The [] are not "special" at all, they are just a separator, the ! is a basic part of NT batches, to use DelayedExpansion: http://www.robvanderwoude.com/variableexpansion.php I really cannot understand the question/problem. Drive letter assignment is NOT carved in stone, every Operating System will assign (or not assign) a given drive letter to a given device or volume along some "rules" or "settings" that are specific to the booted environment, no surprise that a same device or volume will get assigned a different drive letter in different environments. Your code is "botched", however, if you have more than one CD-ROM devices and you want to detect them all: of course that batch will return a single drive letter for the CD-rom, the LAST CD-ROM device found. Also since you are looking for the drive letter, you should NOT loop through all the drive letters as it will be MUCH slower, loop only through the actually Mounted ones, this will be faster: SET cdletter=FOR /F %%A in ('MOUNTVOL^|FIND ":\"') DO (fsutil.exe fsinfo drivetype %%A|find "CD-ROM">nul&&set cdletter=!cdletter! %%A)ECHO CD-ROM drive letter(s) is/are %cdletter%But still there are much faster ways than fsutil fsinfo drivetype to find out if a device is a CD-ROM, *like*: For /F "tokens=3,5 delims=\ " %%A IN ('REG QUERY HKLM\SYSTEM\MountedDevices /s ^|FIND "\DosDevices\" ^| FIND "4300640052006F006D"') DO set CDROM=!CDROM! %%ASET CDROMjaclaz
  23. Sure, partition order is NOT compulsory. But the EFI System partition (the FAT32 formatted one containining the EFI bootmanager will always be of the EFIsys type. Something like this: http://stackoverflow.com/questions/8714675/how-to-detect-if-efi-partition-is-already-mounted-in-windows-via-batch-script might do nicely. JFYI, and as a side note, there is a trick to avoid making the temporary file to feed commands in diskpart, see here: http://www.msfn.org/board/topic/126069-updated-on-feb-27-2011-ordering-messed-drive-letter-batch-file/ http://www.msfn.org/board/topic/126069-updated-on-feb-27-2011-ordering-messed-drive-letter-batch-file/?p=817388 You can find here another example of the technique: http://www.msfn.org/board/topic/173642-mkprilog-batch-to-access-a-same-disk-under-two-different-interfaces/ jaclaz
  24. It is just a "safety" measure (and to use some consistency). There is no real difference on a modern, recent system, the same batch script will run the same as either .bat or as .cmd. In theory a .bat should be associated to command.com (and it would be an actual "dos" batch), whilst a .cmd should be associated to cmd.exe (and it would be a NT batch, NOT a "dos" one, on all NT systems when you open the command prompt or the command window you are NOT running dos, you are running the NT command interpreter). But if you use batches on different OS's you might need to put in them checks to make sure they run on the "right" OS or "refuse" to run on a non-expected OS. If you name a NT batch as .cmd it will NOT run on DOS (MS-DOS or FreeDOS, etc.) and on 9x/Me. jaclaz
  25. If it's OK to use a third party tool either PowerOff: http://users.telenet.be/jbosman/applications.html or Nircmd: http://www.nirsoft.net/utils/nircmd.html should do. jaclaz
×
×
  • Create New...