Content Type
Profiles
Forums
Events
Everything posted by Yzöwl
-
The following will perform exactly the result of your request! copy trial.txt trialnew.txtA file with that specific content will very likely not be what you have, echoing each line of a file to another will also not be the task you need to perform so in order to receive a reasonable solution you will need to provide specifics. This is one of those questions where any solution supplied will be specific only to that question. Please provide a proper sample file and the full procedure you are wishing to perform on each line of that file! Also, please note that with both the trial.txt and script written exactly as above, the result is exactly what you wanted; (the script works fine). This may mean that you have delayed expansion enabled by default, which is not a good thing IMHO. I'd suggest you run the following at the command prompt to ensure it is disabled before re-trying: REG ADD "HKCU\Software\Microsoft\Command Processor" /v DelayedExpansion /t REG_DWORD /d 0 /f <Edit> Additionally, the following should be all you'd have needed if that was your proper script. @For /F %%# In (trial.txt) Do @Echo %%#>>trialnew.txt </Edit>
-
I see so you're updating batch files for an OS which is two generations out of date (it does make me wonder what real use including the following is) ver |find " 6.0">nul &&set TheOS=Vista <snip> if !TheOS! equ Vista set mfile=mountvol_vs.exe My WinPE 3.0 disk doesn't even contain a MountPoints2 registry branch, in fact the only place I can find my drives mentioned in the registry is here: HKLM\SYSTEM\MountedDevices.
-
I've got to be honest here, considering you wrote the code, you're not really helping me much if you cannot explain to me what your intention was for output from a command within it! Your code is looking for \\2 in those subkeys of the mountpoints2 branch. As you can see from both a booted system and a PE environment there is no string using a double backslash never mind one with a 2 followed by one. Since it appears that the registry read is included to replicate the results obtained from the wmic command when that is not available, I expect it to return similar output to that wmic command. Here's a thought! (based purely on my understanding and the result of my real world test with my WinPE disk) If you were to change the Find command within the for to read this: adv= HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\A HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\B HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\C HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\D HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\E HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\X HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\Y HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\{5932c341-8515-11de-9904-806e6f6e6963} HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\{5932c344-8515-11de-9904-806e6f6e6963} HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\{5932c345-8515-11de-9904-806e6f6e6963} HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\{5932c348-8515-11de-9904-806e6f6e6963} HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\{d9b257fc-684e-4dcb-ab79-03cfa2f6b750} adv:~-2= \A \B \C \D \E \X \Y 3} 3} 3} 3} 0} adv:~,1= \ \ \ \ \ \ \ 3 3 3 3 0 adv~-1= A B C D E X Y The resulting ALLDRV variable in that scenario would be: A B C D E X Y So since you were unable to explain, and all I have to go from is this statement: and this (unuseful to an English speaker) information: I have attempted to show you myself! Therefore: Is your code wrong? Is your code written only for a particular version of WinPE (not mine - Vista based)? Are my systems broken? Do I need to learn batch programming? Am I just wrong? Please…
-
Thanks for the acknowledgement of my post… Here is the registry export from a test machine using WinPE (Reg Export HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2 output.reg) output.reg Windows Registry Editor Version 5.00 [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2] [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\A] "BaseClass"="Drive" [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\B] "BaseClass"="Drive" [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\C] "BaseClass"="Drive" [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\D] "BaseClass"="Drive" [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\E] "BaseClass"="Drive" [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\X] "BaseClass"="Drive" [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\Y] "BaseClass"="Drive" [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\{5932c341-8515-11de-9904-806e6f6e6963}] "BaseClass"="Drive" [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\{5932c344-8515-11de-9904-806e6f6e6963}] "BaseClass"="Drive" [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\{5932c345-8515-11de-9904-806e6f6e6963}] "BaseClass"="Drive" [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\{5932c348-8515-11de-9904-806e6f6e6963}] "BaseClass"="Drive" [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\{d9b257fc-684e-4dcb-ab79-03cfa2f6b750}] "BaseClass"="Drive" It follows therefore that the script line I previously asked about will once again return nothing! …explain please!
-
There isn't really two different inf files, the key is the dll files; (setupapi.dll and advpack.dll). The latter, Advanced INF Package Installer, allows for some useful 'advanced' commands in addition to those setupapi allows. If you don't use Advanced INF commands there's no need to use the advpack installer library.
-
That line is used for win pe to get all drive letters from registry. Re-worded:Could you please provide me with a sample of the output from the following command, (when run in the appropriate context), in order for me to assess what is produced. REG QUERY HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\ /s |find "2\\" Thank you.
-
how to glean a line from an xml doc
Yzöwl replied to aspenjim's topic in Programming (C++, Delphi, VB/VBS, CMD/batch, etc.)
@For /f "tokens=3 delims=<>" %%# In ('Find "<path>"^<your.xml') Do @Echo %%#Change your.xml to the proper name and Echo to whatever you need to do with your content %%#. -
Here's a small open source utility which may help or at least bring inspiration.
-
Just a quick question, what is the REG QUERY line in the below section supposed to produce? ::get all drive letters wmic /? >nul 2>&1 if errorlevel 1 ( for /f "tokens=1 delims= " %%a in ('REG QUERY HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\ /s ^|find "2\\"') do ( set adv=%%a set adv=!adv:~-3! set tdv=!adv:~0,2! if !tdv! equ \\ ( set adv=!adv:~-1! set ALLDRV=!ALLDRV! !adv! ) ) ) else ( for /f "skip=1" %%a in ('wmic logicaldisk get caption') do ( set adv=%%a set ALLDRV=!ALLDRV! !adv! ) ) set ALLDRV=%ALLDRV::=% echo All drive letters: %ALLDRV%I do confess I haven't tried to find out from checking all the code, my expectation however was that it would produce a listing the same or similar to the WMIC command. My system doesn't output anything for the REG QUERY hence my question. (see image of output)
-
How to make check files exist on partition from cmd?
Yzöwl replied to kolche's topic in Unattended Windows 2000/XP/2003
You would probably need to check for files or directories not assigned system attributes on mounted fixed drives. Notice that I said fixed, the last thing you'd want is for a removable device to accidentally get filled with data. I would therefore suggest that you require a batch file which uses cscript or a fully fledged vbscript. Untested.cmd @Echo off&Setlocal enableextensions >"%Temp%\_$.vbs" (Echo strComputer = "." Echo Set objWMIService = GetObject("winmgmts:" _ Echo ^& "{impersonationLevel=impersonate}!\\" ^& strComputer ^&^ "\root\cimv2"^) Echo Set colDrives = objWMIService.ExecQuery _ Echo ("Select * from Win32_LogicalDisk where DriveType = '3'"^) Echo For Each objDrive in colDrives Echo wsh.echo objDrive.DeviceID Echo Next) For /f %%a In ('cscript //nologo "%Temp%\_$.vbs"') Do Call :C_ %%a Del "%Temp%\_$.vbs" Goto :Eof :C_ Dir/b/a-ds %1\ >Nul 2>&1&&(Goto :Eof) If Defined _ (Goto :Eof) Else (Set _=T) Echo REM Code goes below here for empty drive [%1] found -
And you definitely have the structure as shown in my post, post 5! I ask because the usual location for the Software directory used on these forums isn't in the root of the CD.
-
That shouldn't happen; during the installation all that happens is that the entries are added to the RunOnceEx key. The install.bat files aren't run until first login.
-
The only thing I can think of, based on you having shown us the entire content of the RunOnceEx.cmd file is that the script doesn't like the ampersand in the title of your first subkey. Try changing "Flash Player & Shockwave" to "Flash Player and Shockwave" and see if that helps! Then if you're still getting an error flash up before it exits try replacing EXITwith Pause
-
You could try some error trapping in your batch file! Replace this: |I386 | '$OEM$ | | | |$1 | | |Install | | | | | 'Drivers | | | |$$ | | 'System32 | | | |$Docs | | | |$Progs | | | |cmdlines.txt | 'RunOnceEx.cmd | 'Software | |Adobe | | | 'Install.bat | |DotNet | | | 'Install.bat | 'cleanup.cmd
-
Are you using a directory named oem?You should have something like this! |I386 | '$OEM$ | |$1 | |Install | | | 'Drivers | |$$ | 'System32 | |$Docs | |$Progs | |cmdlines.txt 'RunOnceEx.cmd
-
Well if you take a look again: You'll see that both are optional. I'd suggest you use Microsoft Update if you are slipping any MS Software, (Security Essentials, Silverlight, Office etc.), otherwise use the Windows Update option. Either way if you are not intending to constantly update and burn the disk or you are not involved in re-installing systems often, I'd leave the frequently updated hotfixes out and just get them at first update anyhow!
-
Thanks I got as far myself, thought about the time I was spending on it, weighed that against the time it would take me to use 'Send to' instead and took that route. At the end of the day I'm only trying out a handful off editors, so the 'Send to' list can be reduced again as I remove the ones I don't like! Anything other than a quick fix would likely have required unfixing when I'd finished anyway.
-
Well, this has really got me riled up, I cannot for the life of me understand why I cannot have the option to 'Open with...' any bat or cmd file. Even adding OpenWithList entries to the FileExts keys doesn't give me the option. I know that I can create entries in the 'Send to' list which is very likely my only real option, I'd just like to have been able to use the same method for bat and cmd fies as for the other file types I generally use.
-
Okay, it does work with many file types but not all the ones I need. For example, I get 'Open with...' on a right-click for .vbs .inf .js .txt .ps1 .reg .ini, but not for .cmd .bat. So I'll reword my question, how do I enable Open with... for .bat .cmd and any other extension which may fail to offer that option.
-
I'm currently trying out a few different text/programming editors, so if I select a cmdfile for instance, I would like the option to 'open with' in order to choose from a list. I don't wish to change the default program for a particular file extension, all I want is an open with options list. In previous OS's a right-click or SHIFT + right-click on the file would reveal that option but not so this time! I even thought of going through the 'change default' process and unchecking the 'always use this program' box in the hope it would create the list for me, however the check box is greyed out and therefore a non-starter. There has got to be a simple solution for this...anyone!
-
Batch file question
Yzöwl replied to tekniik's topic in Programming (C++, Delphi, VB/VBS, CMD/batch, etc.)
Something along these lines should get you there: @Echo off&Setlocal Set K_="HKCU\Software\Microsoft\Internet Explorer\Main" Set V_="Start Page" Set O_=luceweb Set N_=http://lucenet Reg query %K_% /v %V_%|Find "%O_%">Nul 2>&1&&( Reg add %K_% /v %V_% /d "%N_%" /f>Nul) -
Batch file question
Yzöwl replied to tekniik's topic in Programming (C++, Delphi, VB/VBS, CMD/batch, etc.)
Which key are you checking/changing `"Start Page"=` on? HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Internet Explorer\Main HKEY_CURRENT_USER\Software\Policies\Microsoft\Internet Explorer\Main HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\Main What is the 'exact string' instead of the following? http://old_intranet http://new_intranet Although you can change the key to suit, the URL string could be more important to the formation of an appropriate script solution than you may think!