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. With @ECHO OFF, at the head of the script and >NUL at the end of each of the REG ADD lines, no 'successfully' messages will output to the console, in fact, nothing at all will output to the console in the unaltered file as downloaded.
  2. Why in Windows XP would you be wanting to use command.com? What is the file *.abc, unless its file type is known, it will not 'execute'. We use known file extensions for known file types so that the system knows what to do with it.
  3. The verify method suggested is only for older versions of cmd.exe which do not set an errorlevel with setlocal.Could you tell me how as an Administrator I can restrict enabling of extensions, whereby setlocal enableextensions doesn't re-enable them. I have tried setting both HKLM and HKCU to disable in the registry, but my command shown above still works!
  4. That's easy enough to answer, it does run each command silently At the end of each line in the cmd you will find >NUL, that will prevent the 'Operation completed successfully' message being echoed to the console for every line entered.
  5. Okay, technically in order to use %CD%, command extensions should be enabled. Since you have no idea as to whether they are or not, your batch file would need to make sure first. @SETLOCAL ENABLEEXTENSIONS &ECHO/ The current directory is %CD%That's it one line only!
  6. can you not rename /move the bootsector on the floppy and rename /move it back when all is installed?
  7. you could probably shorten that!ECHO/&ECHO/Deleting unwanted shortcuts... DEL "%APPDATA%\MICROSOFT\INTERNET EXPLORER\QUICK LAUNCH\QUICKTIME PLAYER.LNK" "%USERPROFILE%\DESKTOP\QUICKTIME PLAYER.LNK"should be on two lines only
  8. Don't bother with xcopy, for single files PUSHD %ALLUSERSPROFILE%\Start Menu\Programs MOVE "Application Folder\Shortcut.lnk" "New Folder" &&RD /S/Q "Application Folder" etc. POPD
  9. DEL "%USERPROFILE%\DESKTOP\CLEAN.LNK" "%USERPROFILE%\DESKTOP\VIDPATCH.LNK"
  10. also isn't it supposed to be %systemdrive% not $systemdrive% start %systemdrive%\Install\copytodvd\setup.exe /VERYSILENT /SP- start /wait %systemdrive%\Install\copytodvd\sleep.exe 60 start /wait taskkill /IM VsoStart.exe
  11. Now for the fixes The executable is usually named FoxitReader.exe not Foxit Reader.exe The additional parameter at the end of the exe name in the registry should read "%%1" not "%1" when invoked from a batch file. You should really check if a directory exists before making a new one If the file to be copied cannot be found, that directory didn't need making If for any reason the directory creation fails, the file should not be copied and the registry should not be changed If for any reason the file copy fails, the registry should not be changed If for any reason the FTYPE command fails the ASSOC command shouldn't be run The output of both FTYPE and ASSOC do not need echoing to the screen As the location of the executable is changeable as is the destination of the file on your system, give the user an easier opportunity to change those to their own requirements first! @ECHO OFF &SETLOCAL ENABLEEXTENSIONS :: source file /folder location relative to this files location (SET FXREAD=Foxit Reader\FoxitReader.exe) :: your required destination folder name and location (SET MYDEST=%PROGRAMFILES%\Foxit Reader) IF NOT EXIST %FXREAD% (GOTO ENDNOW) IF NOT EXIST %MYDEST% (MD %MYDEST%||GOTO ENDNOW) COPY "%FXREAD%" "%MYDEST%" &&( FOR %%? IN ("%FXREAD%") DO (SET FULLDEST=%MYDEST%\%%~nx?) FTYPE FoxitReader.Document="%FULLDEST%" "%%1">NUL 2>&1 &&( ASSOC .pdf=FoxitReader.Document>NUL)) :ENDNOW ENDLOCAL &GOTO :EOF
  12. From the suggested code I found on this site of AdbeRdr60_enu_basic.exe -p"-s /v\"/qn\""My suggestion for the command would be
  13. Set the font in your preferred Text Editor's options to Terminal, it should give you a wysiwyg output.
  14. The only trouble is you are adding your information to the incorrect key! Here is a long winded example which should help guide you @ECHO OFF &SETLOCAL ENABLEEXTENSIONS SET "PROFLOC1=" &CALL :GETDRVS IF DEFINED PROFLOC1 GOTO :BEGINIT ELSE GOTO :ENDIT :BEGINIT SET USFKEY="HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" SET SFKEY="HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" ECHO/REG ADD %USFKEY% /V Favorites /T REG_EXPAND_SZ /D "%PROFLOC1%\Favorites" /F ECHO/REG ADD %USFKEY% /V "My Music" /T REG_EXPAND_SZ /D "%PROFLOC1%\My Documents\My Music" /F ECHO/REG ADD %USFKEY% /V "My Pictures" /T REG_EXPAND_SZ /D "%PROFLOC1%\My Documents\My Pictures" /F ECHO/REG ADD %USFKEY% /V Personal /T REG_EXPAND_SZ /D "%PROFLOC1%\My Documents" /F ECHO/REG ADD %SFKEY% /V Favorites /D "%PROFLOC2%\Favorites" /F ECHO/REG ADD %SFKEY% /V "My Music" /D "%PROFLOC2%\My Documents\My Music" /F ECHO/REG ADD %SFKEY% /V "My Pictures" /D "%PROFLOC2%\My Documents\My Pictures" /F ECHO/REG ADD %SFKEY% /V Personal /D "%PROFLOC2%\My Documents" /F :ENDIT ENDLOCAL &GOTO :EOF :GETDRVS FOR /F %%? IN ('MOUNTVOL^|FIND ":\"^|FINDSTR/IV "A:\\ %SYSTEMDRIVE%\\" 2^>NUL') DO ( IF ERRORLEVEL 0 (IF NOT DEFINED PROFLOC1 CALL :CHECKIT %%?)) GOTO :EOF :CHECKIT IF EXIST "%1%USERNAME%\MY DOCUMENTS" SET "PROFLOC1=%1%%USERNAME%%" &SET "PROFLOC2=%1%USERNAME%" GOTO :EOF<Edit> I have deliberately added this as an edit so that you will see it! When you have confirmed that it works, remove ECHO/ from the beginning of the eight lines and add >NUL to the end of them. </Edit>
  15. This is how I would do it… ListEm.cmd @ECHO OFF &SETLOCAL ENABLEEXTENSIONS FOR /F %%? in ('MOUNTVOL ^|FIND ":\" ^|FIND /V "A:\"') DO IF EXIST %%?* (CALL :SUB %%?) ENDLOCAL &GOTO :EOF :SUB SET "LET=%1" SET "OUT=%1_%LET:~0,1%_LIST_.TXT" DIR/B/ON/A-D-H %1 >%OUT% 2>NUL ||TYPE NUL>%OUT% FOR /F "DELIMS=" %%? IN ('DIR/B/S/ON/AD-H %1 ^2^>NUL ^|SORT') DO IF ERRORLEVEL 0 ( DIR/B/ON/A-D-H %%? >NUL 2>&1 &&( >>%OUT% ECHO/ >>%OUT% ECHO/%%? >>%OUT% DIR/B/ON/A-D-H %%? ) ) GOTO :EOFThe file could be shortened a little, but I prefer the safeguards and format of the resulting files! Each drive will hold the resulting directory listing text file at its root <Edit> Note This version deliberately ignores hidden files and folders. </Edit>
  16. I have never read books on the subject, I find that it is easier to have a problem you want to solve, and work on solving it, learning snippets along the way. However everyone learns differently, you have a PC, so use it Free interactive Batch Course http://www.allenware.com/icsw/icswidx.htm Batch Reference with examples http://www.allenware.com/icsw/icswref.htm
  17. The message is caused by a problem with your desktop.ini file. The most common cause of this is usually just that the file has lost its correct attributes. Try copying and pasting the following into the Run box and click OK cmd /c @attrib +h +s "%UserProfile%\Start Menu\Programs\Startup\desktop.ini" Now log off and back on again to see if it has worked
  18. ScubaSteve, thank you for your observations. My response wasn't intended as productive comment, if you take a look at the yellow face at the foot of my reply, it would suggest a lack of seriousness. As a side note, however, no responses so far, including your own could be construed as productive! In the interests of tidiness, I prefer the first person singular pronoun to be capitalized, and English vocabulary to be used as opposed to abbreviations.
  19. dont look in the registry... you may want to change HKEY_LOCAL_MACHINE\SOFTWAREto HKEY_LOCAL_MACHINE\Softwareso that it matches HKEY_CURRENT_USER\Softwareor does the HKEY string need changing too? did you notice I only used upper case in my response where necessary so as not to upset you
  20. @ dstone2006 Since Avant uses the IE rendering engine etc., and since your graphic even includes the Internet Options... link to IE, then I would surmise that the blocklist works with Avant as with IE. If you wish to protect Internet enabled apps, such as Firefox, then use the HOSTS file.
  21. Here's a TEE like method which doesn't require 3rd party programs, it uses VBS! Set StdIn = WScript.StdIn Set StdOut = WScript.StdOut Set Args=WScript.Arguments LogFile=Args(0) Set fso = CreateObject("Scripting.FileSystemObject") Set LogFile= fso.CreateTextFile(Args(0)) Do While Not StdIn.AtEndOfStream str = StdIn.ReadLine StdOut.WriteLine str LogFile.WriteLine str Loop LogFile.CloseRun your Batch file with a pipe to the filter executed with CSCRIPT and add the logfile name you require as a parameter. Something like this: MyBatchFile.cmd |cscript//nologo TFILTER.VBS MyLogFile.txt The output of the Batch file is displayed line-by-line and simultaneously captured to MyLogFile.txt line-by-line. If you change the VBS line: LogFile.WriteLine strto LogFile.WriteLine "Line " & (StdIn.Line - 1) & ": " & strthis will number all the lines in the log (but not on screen). Note: You must execute the TFILTER.VBS with CSCRIPT and not WSCRIPT, (STDIN and STDOUT are not available via WSCRIPT).
  22. Registry Tweaks has a space in its name and will not be accepted as correct cmdlines syntax. Rename the directory to REG_TWKS and see if either of these works "REGEDIT /s REG_TWKS\RegistryTweaks.reg" "REGEDIT /s ..\$OEM$\REG_TWKS\RegistryTweaks.reg"
  23. The output about not finding the file isn't stderr, therefore it is not redirected as such. I can copy what the guy below me has written without error, however since he hasn't written anything yet, I am not given the opportunity to do so, it is not my copying that therefore has an error. As the message stated, it cannot find the file, it is the finding which is the problem not the copying. This leads me to an obvious response, fix your coding to prevent these eventualities first. IF EXIST "E:\To Be Copied\A File.ext" COPY "E:\To Be Copied\A File.ext" "G:\Somewhere Else"2>NUL<Edit> I have used NUL, whereas you would obviously use your chosen file, and possibly, depending upon your requirements, append, (>>). </Edit>
  24. The following attachment is included for helping with either the production of the next version or peoples searches of the Regtweaks_Feb_3rd_2006 version. It is a reg file in alphabetical key order. It is in the order that each line would have been run using the glent file as is. This means that any value data processed more than once would have took that which is listed here. I have not checked the validity of the keys, or mafe many corrections. I have removed all descriptive comment, changed all HKCR to HKLM\SOFTWARE\Classes, (as they should be), and made a word change [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Drive\shell\draw] now says [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Drive\shell\drawer] Hope it helps out! Sortedtweaks.zip
  25. What do you mean, anyone?, kelsenellenelvian answered your question. this means that if cmdow.exe is inside the structure you say it is, then it will be copied, subject to the correct setting within winnt.sif, at the stage stated. If it is not being copied, I would suggest you check your winnt.sif for the following OemPreinstall = Yes
×
×
  • Create New...