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. Result is that the space in %%A will block the NET SHARE command. ....... = space I need to obtain the drive letter from MountVol without space behind. Many Thks for your help. Regards. Try using a few more lines! (attempting to compact everything on one line will not make your batch file run any faster) @ECHO OFF FOR /F "DELIMS=:\" %%A IN ('MOUNTVOL^|FINDSTR [C-Z]:\\') DO CALL :SUB %%A GOTO :EOF :SUB NET SHARE %1=%1: /GRANT:"Tout le monde",FULLNote I've changed the possible drive letters output to exclude A: and B: drives.
  2. It is variable expansion and character substitution. We need to do this because you cannot have a file name containing the date seperator you've indicated is being used. In basic terms the %DATE% variable is expanded and then the /, (forward slash), is substituted for a -, (hyphen. See some examples here.
  3. Now that you've decided to change the order of the tokens in the date output, you don't need a 'for' statement and you certainly don't need to start enabling 'delayed expansion'. >RegSettings-Results(%DATE:/=-%).log (ECHO=RegSettings-Results:&ECHO=)
  4. Perhaps this will do you. @FOR /F "TOKENS=1-3 DELIMS=/" %%A IN ('DATE /T') DO @( >"%LOGPATH%\RegSettings-BSPResults(%%B-%%A-%%C).log" ( @ECHO=RegSettings Results:&ECHO=))
  5. You've asked for help; that is a two way deal, the more you give us, the more we can give back. How far have you got with it, what are you using to create your installer, is it console or GUI based? Will WPI not do what you require?
  6. @vglnT - We really do need you to reply to IcemanND's question. @allen2 - AutoIT's beauty is in its scripting of GUI stuff, I'd see it as overkill for a simple task doable with built-in tools. When I say built-in I mean either to the software which builds the installation package, (InstallShield for instance has this feature), or to script it separately using components already part of the end users Operating System.
  7. I'd suggest that you don't need to look into the output results too deeply. The output appears, from the example you provided, to list each horizontal x Vertical lowest to highest and follows that for colour depth and frequency. Your script will therefore be okay to just retrieve the data from the bottom most line containing your chosen mode. If you wanted the largest resolution using a larger Horizontal than Vertical then: @ECHO OFF & SETLOCAL FOR /F "TOKENS=1-3,5 DELIMS=x,@ " %%a IN (Qres.txt) DO ( IF %%a GTR %%b (SET "X_=%%a" & SET "Y_=%%b" & SET "C_=%%c" & SET "H_=%%d")) ECHO=Highest RES IN Qres.txt IS %X_%x%Y_% %C_% bits @ %H_% Hz. PING -n 6 127.0.0.1 1>NULIf you required a larger Vertical than Horizontal then: @ECHO OFF & SETLOCAL FOR /F "TOKENS=1-3,5 DELIMS=x,@ " %%a IN (Qres.txt) DO ( IF %%a LSS %%b (SET "X_=%%a" & SET "Y_=%%b" & SET "C_=%%c" & SET "H_=%%d")) ECHO=Highest RES IN Qres.txt IS %X_%x%Y_% %C_% bits @ %H_% Hz. PING -n 6 127.0.0.1 1>NUL Hope this helps!
  8. You could use a commandline entry directly from runonce or runonceex or you could implement it using a script. winnt.sif is not invoked on first boot, therefore it could only be used to pre-populate a command somewhere for later invokation. You may use this method if you prefer, (although it would be less flexible). It would not be advisable however to implement both, i.e. 'duplicate'.
  9. -X- has answered the question twice. Topic Closed.
  10. You don't need a batch file, you only need the RunonceEx command to invoke the .exe file directly.
  11. I'm not sure that I get what you want! Pre-Vista there was an 'up button' to move up an explorer directory, this was changed to the handier address bar system from Vista onwards. That said, if you select a file or directory in an explorer window, then you must already be located within it's parent directory!
  12. Topic Closed!
  13. The parent/containing directory will not delete because you have it open in explorer. Try invoking it in a cmd console or from the run box and that directory will delete too! As far as making it more universal goes, you could forget about using an app name and use the name of the directory instead. This could be implemented easily: @ECHO OFF IF "%~dp0"=="%~d0\" ( ECHO=You are in the root directory. GOTO ENDIT) IF /I "%~dp0"=="%PROGRAMFILES%\" ( ECHO=You are in the Program Files directory. GOTO ENDIT) ECHO=%~dp0|FINDSTR/IB %SYSTEMROOT%\ >NUL &&( ECHO=You are within the Windows directory tree. GOTO ENDIT) CLS SETLOCAL SET "PN=%~p0" :LOOP IF "%PN:*\=%" NEQ "" (SET "PN=%PN:*\=%"&&GOTO LOOP) SET "PN=%PN:~,-1%" TITLE Uninstall %PN% SET/P "R_=Do you wish to uninstall %PN%? [Y|N]: " ECHO= IF /I %R_:~,1%' NEQ Y' ( ECHO=You have cancelled Uninstall %PN% GOTO :ENDIT) CLS ECHO=You have selected ^"%R_%^" to uninstall %PN%. PAUSE ECHO=Removing this folder and it's sub-folders.... ECHO= ECHO=RD/S/Q "%~dp0" :ENDIT ECHO= ECHO=Closing! PING -n 6 127.0.0.1 1>NUL
  14. Please see the updated code in my previous post Side note: In order to make this script more universal, I'd suggest you implement a method which prevents you from having to set %PN% manually inside each script!
  15. I'm not sure if I fully understand your intentions so I've quickly knocked up something which I hope is set out in a more systematic approach. (I've deliberately not used long lines or concatenation etc. in order to help readability) @ECHO OFF IF "%~dp0"=="%~d0\" ( ECHO=You are in the root directory. GOTO ENDIT) IF /I "%~dp0"=="%PROGRAMFILES%\" ( ECHO=You are in the Program Files directory. GOTO ENDIT) ECHO=%~dp0|FINDSTR/IB %SYSTEMROOT%\ >NUL &&( ECHO=You are within the Windows directory tree. GOTO ENDIT) CLS SET PN=AppnameXYZ TITLE Uninstall %PN% SET/P "R_=Do you wish to uninstall %PN%? [Y|N]: " ECHO= IF /I %R_:~,1%' NEQ Y' ( ECHO=You have cancelled uninstall %PN% GOTO :ENDIT) CLS ECHO=You have selected ^"%R_%^" to uninstall %PN%. PAUSE ECHO=Removing this folder and it's sub-folders.... ECHO= ECHO=RD/S/Q "%~dp0" :ENDIT ECHO= ECHO=Closing! PING -n 6 127.0.0.1 1>NULWhen you are satisfied that this will work, you can remove the first five characters from line number twenty four, (to test the actual directory removal). NOTE: You do need to be careful that you do not confuse the Current Folder with that of the Running Script.
  16. Instead of using the 'dos output character', >, you could use wmics own method. e.e. WMIC /OUTPUT:Reports\AppLog.html NTEVENT WHERE "LogFile='Application' AND Type='Error'" GET LogFile,Type, Message,TimeGenerated /FORMAT:hformObviously all on one line!
  17. Based on your opening post and the fact you said you understand batch scripts, would this do you? @ECHO OFF & SETLOCAL ENABLEEXTENSIONS SET "RP_=%SYSTEMROOT%\OOBE\OEM" FOR /F "SKIP=1 TOKENS=*" %%# IN ( 'WMIC COMPUTERSYSTEM GET MANUFACTURER') DO CALL :SUB %%# PAUSE & GOTO :EOF :SUB IF %1' EQU ' GOTO :EOF IF EXIST "%RP_%\%1\%1.REG" REGEDIT /S "%RP_%\%1\%1.REG"
  18. I thought I had once got it wrong but I was mistaken!

  19. Which bit of the following confuses you! As far as unattend.txt goes, Windows XP will use a file named winnt.sif first, (if found in an appropriate location), if not then it can use the supplied, (and edited as required), unattend.txt. Have you taken a look at ref.chm? as mentioned within the comments at the head of your unattended file
  20. Although they appear similar, there are some differences between unattend.txt and winnt.sif. (I'd suggest you rename your newly created file to winnt.sif). You do not need to include a particular value or its pertinent data if you wish for it to be requested during the installation, (so either leave the data blank or comment out/remove, for instance, the 'TargetPath' line).
  21. To upgrade, try a standard Service Pack 3 installation disk, not an unattended Windows with integrated Service Pack one. a replacement optical drive will probably be the cheapest component you can buy for your computer, I'd also suggest you invest in one of those
  22. Take a look at the first item here and the fourth item here
  23. Seconded, however, until you've logged out and return again, I couldn't say whether this is due to resetting as part of the upgrade or an actual problem. Will there be Sign-in boxes at the top of the Forums index page instead of a link to a Sign-in page?
  24. If it were based on browsing history, what would these say about me? http://www.hfslip.org http://hfslip.org English (UK), Browser identified as Firefox, Safari, Chrome, IE, Opera etc. all give similar or same results. Regardless of the differences in the results between different people, I see no reason to remove any links to those addresses. It would simply save a small minority of a small minority of our forum readership unaware that the project is finished from potentially clicking on one.
×
×
  • Create New...