Jump to content

Yzöwl

Patron
  • Posts

    4,113
  • Joined

  • Last visited

  • Donations

    0.00 USD 
  • Country

    United Kingdom

Everything posted by Yzöwl

  1. I've seen the oneless file, it is taken from the thread I linked to. Your question was how to register with avi, oneless reply was all supported file types as was the thread I linked to. The cmd file I posted was exactly that!
  2. I said sometimes... Anyhow, the link I gave did have the answer you required and more! Here's what I've taken from it for you BSPAVI.CMD @ECHO OFF SETLOCAL FOR %%? IN ("%PROGRAMFILES%") DO (SET SHORTPF=%%~sA) REG ADD HKCR\.AVI /VE /D "BSPlayerFile.AVI" /F >NUL REG ADD HKCR\BSPlayerFile.AVI\DefaultIcon /VE /D "%SHORTPF%\Webteh\BSplayerPro\bsplayer.exe,3" /F >NUL REG ADD HKCR\BSPlayerFile.AVI\shell\open\command /VE /D "%SHORTPF%\Webteh\BSplayerPro\bsplayer.exe \"%%L\"" /F >NUL ENDLOCAL EXIT
  3. how about changing it to this @ECHO OFF &SETLOCAL ENABLEEXTENSIONS SET "wpidir=%~dp0" IF "%~d0" EQU "\\" (FOR /F "DELIMS=" %%? IN ("%~dp0") DO SET "wpipathpart=%%~nx?") IF DEFINED wpipathpart (CALL :GETDRV "%%wpidir:\%wpipathpart%=%%") ECHO %wpidir% &&PAUSE ENDLOCAL &GOTO :EOF :GETDRV FOR /F "TOKENS=2" %%? IN ('NET USE * %1 /PERSISTENT:NO ^|FIND "Drive"') DO (SET "wpidir=%%?\%wpipathpart%") GOTO :EOFJust change /remove line 5 to suit your original intention. </Edit>
  4. Sometimes a forum search can work wonders
  5. Read the third section here, see if it helps.
  6. you would probably have been better using if not errorlevel 1 goto instLCD however you could try this vol c:|find "BALCD">NUL 2>&1 &&goto instLCD vol c:|find "BACRT">NUL 2>&1 &&goto instCRT If you are having the problems as you say with the pipe from a cd-rom then @for /f "tokens=6" %%? in ('vol c:') do ( @if "%%?" equ "BALCD" goto instLCD @if "%%?" equ "BACRT" goto instCRT)
  7. As a follow on from Delprats comments, the problem you had would be solved by re-structuring the code, not by adding delayed expansion @echo off if "%Username%" equ "Test" call :istest goto :eof :istest (set choice=) (set /p choice= Do you want to continue? [y/n] ) echo/ You entered: %choice% pause goto :eofHowever, you really should be doing some sort of checks on the user input before continuing with the script. What if they entered g instead of y or n what if they entered Y or N instead of y or n what if they entered Harry Potter instead of y or n what if they entered nothing at all and just hit the enter key etc.
  8. <Edit> Removed original message due to the fact I didn't bother reading before I replied! </Edit>
  9. have a look at this message. It is basically from a problem with previous incorrect formatting within code boxes on the forum. Any code, usually reg code containing hex strings, copied and pasted could have carried this problem.
  10. Try this! [FavoritesEx] Title1 = Bloomberg.url URL1 = http://www.bloomberg.com/ Title2 = Reuters.url URL2 = http://www.reuters.com/ Title3 = Expenses URL3 = https://my.concureworkplace.com/quotation marks not required, but http:// is.
  11. Have you tried to use the SourceDisksNames Section with a DiskID Description and Tag-file?
  12. A method of creating a directory which is practically inaccessible using standard tools. He created a directory named s. which although can be copied to from etc. cannot be entered etc. To remove it rd /s/q s..\ @ lanyus You would have made your post a little easier to read had you used dir /b
  13. Alternatively use GSAR (Global Search And Replace) Utility gsar -stimeout=3 -rtimeout= -io %SystemDrive%\boot.ini &&attrib +r +s +h %SystemDrive%\boot.iniYou will probably only require the executable, gsar-1.12-bin\bin\gsar.exe from the zip file.
  14. What is trying to be achieved? Don't get me wrong, I haven't got a problem creating a piece of code to 'split' the MULTI_REG_SZ into its multiple entries, I just dont know why. In the meantime, here is a snippet which will create a text file named tmp_.txt, containing up to 9 strings from the MULTI_REG_SZ data @echo off &setlocal enableextensions set key="HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup" set val="Installation Sources" for /f "skip=1 tokens=3 delims= " %%? in ('reg query %key% /v %val% ^2^>nul') do if errorlevel 0 set "dat=%%?" if not defined dat goto end set "dat=%dat:\0\0=%" &set "dat=%dat:\0=ž%" for /f "tokens=1,2,3,4,5,6,7,8,9 delims=ž" %%a in ("%dat%") do ( for %%? in ("%%a" "%%b" "%%c" "%%d" "%%e" "%%f" "%%g" "%%h" "%%i") do if "%%~?" neq "" echo>>tmp_.txt %%~? ) :end endlocal &goto :eofwhere, on line 4, delims=<tab> Hope it helps you out!
  15. Yes, no problem! In fact since that key doesn't exist, add the REGEDIT4 header to the top and an empty line at the bottom and try it!
  16. Although %USERNAME% isn't used in your batch file, you could probably replace it with the following shorter code.if not defined username for %%? in ("%userprofile%") do set username=%%~nx?The quotes around the %userprofile% are needed just in case the username contains spaces and the x in the variable expansion just in case there is a stop in the username. It will help your code on occasions where the profile directory has been redirected to any location which is not one level below root i.e drive:\parent\username (the third token would be okay) drive:\windows\profiles\username (the third token would be incorrect) There may still be problems with even the improved code on some part installed systems however. If a user name has been changed, after creation of their profile folder its profile name often remains at the original thereby not holding the %username%. The /Y switch should not be required in a batch file You may prefer to use RD for directory removal The /Q switch is only used to prevent prompts with wildcards and therefore not required with single named files.I hope this information helps!
  17. The call command was what I was trying to explain in my cryptic response previously, I quoted only that line of the batch file and spelled out what it did. However the response was: Without the call, control would not be passed back to the invoking script, after running any installit.cmd.
  18. The switchless installer isn't going to run the program, it's going to install it! All that is needed again is the correct placement of back-slashes as escape characters for quotation marks.
  19. If as you have already stated WMIC NicConfig Where Description="Intel(R) PRO /Wireless 2200BG Network Connection - Miniport for pakkeplanlegger" GET MTUworks, then there's is no problem with WHERE! Now look at mineWMIC NICCONFIG WHERE MACADDRESS="00:0E:35:2C:20:A7" CALL SETMTU 1500there's no space=space before the MTU value.
  20. In the comment file: Start Menu - Shortcut=S Desktop - Shortcut=D Start Menu\Programs - Shortcut=P Startup - Shortcut=T
  21. Here is an example of an inf [Version] Signature = $Windows NT$ [DefaultInstall] UpdateInis = ProgLinx [ProgLinx] ;program 1 setup.ini, progman.groups,, "group0=""%16408%\""" setup.ini, group0,,"""ShortCut1 Name with spaces"",""""""%16422%\Directory1Name\Prog1Name.exe""""""" ;program 2 setup.ini, progman.groups,, "group1=""%16408%\""" setup.ini, group1,,"ShortCut2Name_no_spaces,""""""%16422%\Directory2Name\Prog2Name.exe"""""",,,,""%HOMEDRIVE%%HOMEPATH%""" ;program 3 setup.ini, progman.groups,, "group2=""%16408%\""" setup.ini, group2,,"""ShortCut3 Name with spaces"",""""""%16422%\Directory3Name\Prog3Name.exe"""" /s"",,,,""%HOMEDRIVE%%HOMEPATH%"""In these examples, All three shortcuts are created in %16408% which is a special code for %ALLUSERSPROFILE%\Start Menu\Programs\Startup The program executables are all found in %16422% which is a special code for %ProgramFiles% In the second and third examples, the %HOMEDRIVE%%HOMEPATH% is the Start-in section of the shortcut. (optional) You will see a difference in numbers of quotation marks depending upon spaces in the shortcut names. Finally the third example shows a method of incorporating a program to run with a switch, in this case /s. Hope the info helps
  22. Agreed...to do those tasks, on an installed system, it is a superb tool. I use robocopy often, I just felt that as an alternative to your script, it would be nice to also have an option where a non-standard tool didn't need adding to your installation source. Since the built in tool was capable of copying the I386 directory tree excluding the SVCPACK directory and contents, then I felt it worthy of inclusion. I also added mine to show things like if the I386 already exists at %SystemDrive% add the reg entries but do not copy. If for some reason something prevents the I386 from being created on %SystemDrive% no reg entries are added. I actually liked the fact in this case that the vbs was not five times longer than the batch! <Edit> maxXPsoft, have you ever tried XXCOPY, click this link for a comparison. </Edit>
  23. firstly Bilou, lets look at the wmic methods from earlier in the thread... Try this @ECHO OFF SETLOCAL ENABLEEXTENSIONS FOR /F "USEBACKQ SKIP=1" %%? IN ( `WMIC NICCONFIG WHERE "MACADDRESS='00:0E:35:2C:20:A7'" GET SETTINGID ^2^>NUL` ) DO ( IF ERRORLEVEL 0 SET SVCNAME=%%? ) IF DEFINED SVCNAME ECHO/%SVCNAME% ENDLOCAL GOTO :EOFor using the description @ECHO OFF SETLOCAL ENABLEEXTENSIONS FOR /F "USEBACKQ SKIP=1" %%? IN ( `WMIC NICCONFIG WHERE "DESCRIPTION='Intel(R) PRO/Wireless 2200BG Network Connection'" GET SETTINGID ^2^>NUL` ) DO ( IF ERRORLEVEL 0 SET SVCNAME=%%? ) IF DEFINED SVCNAME ECHO/%SVCNAME% ENDLOCAL GOTO :EOF<Edit> Bilou, I nearly forgot @ECHO OFF &SETLOCAL ENABLEEXTENSIONS :: Set the description of NIC to find ServiceName SET "NIC=Intel(R) PRO/Wireless 2200BG Network Connection" FOR /F "DELIMS=" %%? IN ('REG QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkCards" ^|FINDSTR \\[0-9]*$ ^2^>NUL') DO IF ERRORLEVEL 0 CALL :NIC "%%?" IF DEFINED SvcName (ECHO/%SvcName% &PING -n 11 127.0.0.1 >NUL) ENDLOCAL &GOTO :EOF :NIC REG QUERY "%~1" /v "Description" |FINDSTR/I "%NIC%" >NUL 2>&1 ||GOTO :EOF :: 3 tokens are Name Type and Data under selected Key :: delims is a tab delimiter FOR /F "SKIP=1 TOKENS=3 DELIMS= " %%? IN ('REG QUERY "%~1" /v "ServiceName" ^2^>NUL') DO IF ERRORLEVEL 0 SET SvcName=%%? GOTO :EOF </Edit>
  24. A similar batch idea without the '3rd Party' robocopy @ECHO OFF&SETLOCAL ENABLEEXTENSIONS MODE 34,5&COLOR E5&TITLE Script By Yz”wl SET SRC=%SYSTEMDRIVE%\I386 FOR /F %%? IN ('MOUNTVOL^|FIND ":\"^|FIND /I /V "A:\"') DO IF EXIST %%?I386 CALL :DOCOPY %%? IF EXIST %SRC% CALL :DOREGS HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup PING -n 11 127.0.0.1 >NUL ENDLOCAL&GOTO :EOF :DOCOPY IF EXIST %SRC% (GOTO :EOF) ELSE (MD %SRC%) TITLE Copying %1I386 to %SRC% ECHO/ COPY IN PROGRESS...&ECHO/&ECHO/ Please wait, it may take a while ECHO>EXCLUDE_.TXT SVCPACK XCOPY %1I386 %SRC% /E/C/I/Q/H/K/EXCLUDE:EXCLUDE_.TXT DEL EXCLUDE_.TXT GOTO :EOF :DOREGS TITLE Adding Registry Info REG ADD %1 /V "Installation Sources" /T REG_MULTI_SZ /D "%SRC%\0" /F REG ADD %1 /V SourcePath /D "%SRC%" /F REG ADD %1 /V ServicePackSourcePath /D "%SRC%" /F GOTO :EOF
  25. @ECHO OFF SET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx REG ADD %KEY% /V TITLE /D "Round Two..." /F REG ADD %KEY%\000 /VE /D "Assassin" /F REG ADD %KEY%\000 /V 1 /D "\"%programfiles%\Assassin\Assassin.bat\"" /F EXIT
×
×
  • Create New...