Content Type
Profiles
Forums
Events
Everything posted by Yzöwl
-
Does anyone know if we can just copy the resultant wmfhotfix.dll and register it! From the installation of the program on an existing system I cannot see that it needs anything else, however running the checker still shows the system is vulnerable...
-
copy shortcut to quick launch fails?
Yzöwl replied to hamohd70's topic in Unattended Windows 2000/XP/2003
If sounds as if you are not running the batch file from the same directory as the location of the .lnk file. In the case of the self-extracting EXE method you say works, the code will be running from the same location. Either CD to that location first or PUSHD and POPD or use the full path COPY X:\PATH_TO\Picasa2.lnk "%AppData%\Microsoft\Internet Explorer\Quick Launch" -
Either remove the coded section and include the file as an attachment, or edit the message and replace the tags with
-
What's the content of d:\test\office? and what are you trying to do? Copy many files and folders, just one folder and its conrnts of a single or many files...
-
@ Vadikan I'm sorry for not responding to your PM, the point I need to make is that my batch file example(s) were in reply to the thread starter, bobthenob, not costi. My only response to costi was in fact made specifically to them by name and in response to their question.
-
The /A switch without additional attributes is 'non-documented' If you try to delete any file at the command line which has System File attributes of (S) you will get an error message Could Not Find Drive:\Folder\SubFolder\file.ext If you use DEL /A:S file.ext and file.ext happens not to be a system file you will just get the Could Not Find Drive:\Folder\SubFolder\file.ext message again. The /A switch alone will prevent these scenarios in both cases and save you having to use the alternative method of ATTRIB -S file.ext&&DEL file.ext
-
%SYSTEMROOT%%\system32\rundll32.exe setupapi.dll,InstallHinfSection <section> <reboot-mode> <inf-name>If <inf-name> isn't a Windows .inf file, add 128 to the reboot mode value. %SYSTEMROOT%%\system32\rundll32.exe setupapi.dll,InstallHinfSection DefaultInstall 128 <inf-name>
-
REG ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Run" /V pie /D isgood /F>NULThe >NUL is optional it prevents a successful message
-
If the new copy of the help.exe isn't required in the dllcache directory then DEL %SYSTEMROOT%\SYSTEM32\DLLCACHE\HELP.EXE&© HELP.EXE %SYSTEMROOT%\SYSTEM32The /Y should only be required if the command isn't invoked from a batch file. People do tend to mistake the /Q switch for DELETE as meaning quiet which is incorrect and should not be necessary in this case. However if you were unsure about the files attributes you could go with DEL /A %SYSTEMROOT%\SYSTEM32\DLLCACHE\HELP.EXE&© HELP.EXE %SYSTEMROOT%\SYSTEM32
-
The only two questions from the opening gambit as I see it are 1. How to determine if D: exists 2. How to move 'My Documents' to D:The only code I and no other respondee gave was one to search for the existence of D:. However as a simple fix for that a simple change to line 2 to this may help IF NOT EXIST D: (GOTO :EOF) ELSE (SET DRIVE=D:) The later mention of junctions does however cause confusion. If the profiles directories are moved to D: then as a direct result of that move and as a container for the 'My Documents' folder the registry will be updated accordingly. As I stated earlier the 'User Shell Folders' data is by default of type REG_EXPAND_SZ. The keys in question by default use the %USERPROFILE% variable which in this case will expand to D:\Documents and Settings\Users_Name\My Documents..., thus negating the need for any additional changes.
-
Yes I'm sure, the key is reg_expand_sz for that reason. Otherwise I would have said@ECHO OFF&SETLOCAL ENABLEEXTENSIONS SET DRIVE=D: SET USF=Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders SET MYDOC=%DRIVE%\%USERNAME%\My Documents SET MUSIC=%MYDOC%\My Music SET PICS=%MYDOC%\My Pictures REG ADD "HKCU\%USF%" /V "My Music" /D "%MUSIC%" /F >NUL REG ADD "HKCU\%USF%" /V "My Pictures" /D "%PICS%" /F >NUL REG ADD "HKCU\%USF%" /V Personal /D "%MYDOC%" /F >NUL ENDLOCAL&GOTO :EOFAlso, the Windows NT Command Script syntax uses :: for a remark /comment not the old batch method of REM. <Edit>costi During install</Edit>
-
%USERNAME% has been used so that each current or future user will have their own personal folder with the same name as their login name. This folder will be the container for their personal files. If the D: drive, in this case, is using NTFS, then these folders should hopefully be private, security wise, to disallowed users.
-
The following batch file should suffice @ECHO OFF&SETLOCAL ENABLEEXTENSIONS SET DRIVE=D: SET USF=Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders SET MYDOC=%DRIVE%\%%USERNAME%%\My Documents SET MUSIC=%MYDOC%\My Music SET PICS=%MYDOC%\My Pictures REG ADD "HKCU\%USF%" /V "My Music" /T REG_EXPAND_SZ /D "%MUSIC%" /F >NUL REG ADD "HKCU\%USF%" /V "My Pictures" /T REG_EXPAND_SZ /D "%PICS%" /F >NUL REG ADD "HKCU\%USF%" /V Personal /T REG_EXPAND_SZ /D "%MYDOC%" /F >NUL ENDLOCAL&GOTO :EOFJust change the second line to suit!
-
or I suppose... COPY HELP.EXE %SYSTEMROOT%\SYSTEM32\DLLCACHE COPY HELP.EXE %SYSTEMROOT%\SYSTEM32
-
in each of the examples I gave, you would of course need to be at least in the root of the CD e.g. @echo off&setlocal enableextensions for /f "usebackq skip=1" %%? in (`wmic cdrom where "MediaLoaded='TRUE'" get drive ^2^>nul`) do if errorlevel 0 set CDROM=%%? if not defined CDROM endlocal&goto :eof pushd %CDROM% for /f "delims=" %%? in ('dir/b/s/a-d "doIT.exe" ^2^>nul') do if errorlevel 0 call :RunIt "%%~f?" popd&endlocal&goto :eof :RunIt start "" /w %1 goto :eof another method too for /f "delims=" %%? in ('dir/b/ad') do ( if exist "%%?\doIT.exe" ( pushd %%? start "" /w doIT.exe popd ) )
-
Try something like this for /f "delims=" %%? in ('dir/b/s/a-d "doIT.exe" ^2^>nul') do if errorlevel 0 start "" /w "%%~f?"or for /r %%? in ('dir/b/a-d "doIT.exe" ^2^>nul') do if errorlevel 0 start "" /w "%%~f?"
-
@ druiddk It will be helpful since I answered the question in the thread title, cmdow @ /HID?, Is it supposed to show?, as opposed to the first post which was answered already by yourself.
-
Just turn off the echo first @echo off cmdow @ /HIDTo be quite honest, unless you use the two commands in this order, it is pointless using the @echo off command, since echoes to a hidden window will not show anyhow!
-
Logging in .cmd?
Yzöwl replied to RayOK's topic in Programming (C++, Delphi, VB/VBS, CMD/batch, etc.)
Try some command >output.txt 2>&1 -
Pals of Mine freaked out from the worm-like Message!
Yzöwl replied to Wesmosis's topic in Unattended Windows 2000/XP/2003
just add something like this single line to your usual batch file ping -n 31 127.0.0.1>nul&wmic OS WHERE Primary="TRUE" CALL Win32Shutdown 6Where 31 is 30 seconds delay (16 would be 15 seconds delay), and the 6 at the end is 2 (reboot) + 4 (force) -
"Right Click ----> List Contents" tweak
Yzöwl replied to totoymola's topic in Unattended Windows 2000/XP/2003
Spaces in file names, mine does; it'd be a pretty pointless tool for the majority of users otherwise. If anyone else has found this please confirm. <Edit> A quick fix for the problem (with the inf file). change DefaultDestDir = 11to DefaultDestDir = 16410and HKCU,Software\Classes\Folder\shell\%THISFILE%\command,,,"%11%\%THISFILE%.exe ""%1"""to HKCU,Software\Classes\Folder\shell\%THISFILE%\command,,,"%16410%\%THISFILE%.exe ""%1"""The zip has been fixed to suit </Edit> -
There is no difference, %WINDIR% is however a legacy carry over, therefore try to use %SYSTEMROOT% wherever possible on 2k and newer.
-
"Right Click ----> List Contents" tweak
Yzöwl replied to totoymola's topic in Unattended Windows 2000/XP/2003
Attached is an archive containing an inf file, which will install the also enclosed compiled batch file I now use, for right-click directory contents listings. I moved to this method simply because I wanted a much cleaner, output. Install the inf using right click install option or the usual command line for the DefaultInstall section <Edit> The zip has been re-upped due to fix for error noted in my next post below, sorry for any inconvenience caused. </Edit> <Edit2> Updated version added, this one names the output file using the date and time and retains previous ones. It ignores hidden files and folders, since the majority of the time their inclusion is a nuisance. It saves as a hidden file itself. </Edit2> DirList.zip -
copy "%programfiles%\flashfxp\flashfxp.lnk" "%userprofile%\desktop"
-
Delte all %WinDir%\*.bmp BUT ONE.
Yzöwl replied to BoardBabe's topic in Unattended Windows 2000/XP/2003
@ MOONLIGHT SONATA These three lines should do what you want @ECHO OFF&PUSHD %SYSTEMROOT% FOR /F "DELIMS=" %%? IN ('DIR/B/A-D "*.BMP" ^2^>NUL^|FINDSTR/LIVE "PRAIRIE\ WIND.BMP SOAP\ BUBBLES.BMP WINNT.BMP WINNT256.BMP"') DO IF ERRORLEVEL 0 DEL /F/A/Q "%%?" POPD&GOTO :EOFjust remove the @ECHO OFF& and &GOTO :EOF to add to an existing batch file. <Edit> For those of you wishing to alter the code to suit your own preferences, the backslashes in the above code act as escape characters for the spaces in the file names </Edit>