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. Try using the following as the basis of your file, just adding any further sections to the bottom and replacing only the red stuff. <Edit>If you have used nLite as suggested in another response, you should have both said so and posted this question in the nlite forum, instead of here. </Edit>
  2. as I have already stated... not
  3. simple spelling mistakes... UnattendSwitch="yes"
  4. Well it should work fine unattended too, it's only a batch file...
  5. You could try this instead! REGEDIT4 [HKEY_CURRENT_USER\Software\WinRAR\Interface\Themes] "ShellExtBMP"="%ProgramFiles%\\WinRAR"Or using reg.exe REG ADD HKCU\Software\WinRAR\Interface\Themes /V ShellExtBMP /T REG_EXPAND_SZ /D "%%ProgramFiles%%\WinRAR" /F<Edit> The above should be one single line </Edit>
  6. You must also have the following entry [Branding] BrandIEUsingUnattended = Yes
  7. Unzip the command script and double click it. After doing so whenever you 'right click' a shortcut, and choose 'Find Target', an 'explorer' window will open at the directory containing the target. FindTarg.zip
  8. Perhaps something along these lines may help @ECHO OFF &SETLOCAL ENABLEEXTENSIONS SET "n=14" &SET "prefix=backups_" FOR /L %%? IN (1,1,%n%) DO IF %%? LSS 10 (IF NOT EXIST %prefix%0%%? MD %prefix%0%%?) ELSE (IF NOT EXIST %prefix%%%? MD %prefix%%%?) ENDLOCAL &GOTO :EOFJust change the prefix from backups_ to your preferred choice and set your n to the appropriate value for the last number in the sequence, I used 14, for this example.
  9. My script, as do all of mine, works flawlessly. The script section I posted, and since removed, was done simply to attract a response from someone who assumed I didn't know what I was talking about. It was not workable, since it is not my place to rewrite your work but did however contain enough information to help you improve your script, essentially to incite you to slightly change the order of your thinking. I have also re-wrote the entire HFSLIP script, but as it is not my script to correct, I too have not made corrections directly to the board. The msxml section, which was in serious need of tidying, was sent to tommyp for comment and later included, as have many other suggestions which for some reason have been ignored. Even the :HFEYzowl submission I made has been severely altered although never updated within the main script. Also I have no idea what the :HFEYzowleX is even supposed to do, though it appears to carry my name. Although I am not saying that the scripts posted will not work, there are lines in there that are either not required or slow down the process. Next time you run HFSLIP_60121.cmd for instance, do it from the cmd window with the following line: HFSLIP_60121 2>error.txtwhen the script has finished, look at the error.txt file!
  10. There is a problem with your script, msxml*.msi and msxml.msi are the same.
  11. You are nearly there This will input %%a into code.bat as a parameter %1Therefore your code.bat should look something like this: md %1\installThis would then run the following md \\pc1\c$\install md \\pc2\c$\installHope this helps
  12. My previous response was simply an improvement to jdoes code, not a complete answer. Here however is my solution @echo off for %%? in ("%~dp0..") do set parent=%%~f? echo/%parent% is your parent directory goto :eof
  13. You could try this compiled batch file! It was coded for Windows XP and can not be run successfully by Limited users SafeBoot.zip
  14. works well enough for me like this @echo off setlocal enableextensions set count=-3 For /F %%i in ('reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains"') Do call :increase echo Blocked Domains: %count% endlocal goto :eof :increase set /A count=%count%+1 goto :EOFHere is my alternative version @echo off&setlocal enableextensions&mode 30,2&color e5&title Script By Yz”wl set "key=\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains"&set "count=0" for /f "tokens=*" %%? in ('REG QUERY "HKLM%key%" /s^|find "%key%\"^2^>nul') do if errorlevel 0 echo/%%~nx?|findstr/v "[.]">nul 2>&1||set/a count+=1 echo/ You have %count% Blocked Domains&ping -n 6 127.0.0.1>nul&endlocal&goto :eofshould be four lines
  15. I have compiled a batch file which may suffice... To use it, run the exe with two parameters, the first being the source directory and the second being the directory you need populating single line run box example using your sample and with my exe in the root of E: E:\matchdir.exe "C:\Documents and Settings\Administrator\My Documents\My Pictures" F:\backed_up_pictures matchdir.zip
  16. You could also try renuser.exe
  17. or pushd.. set parent=%cd% popd
  18. Lets take the above: If * = F:\Software and contains three subfolders named Program1, Program2, Program3 i.e. F:\Software\Program1, F:\Software\Program2, F:\Software\Program3 then for each directory in F:\Software do ( Program1\installit.cmd Program1 %DIR%Program1 %KEY% Program2\installit.cmd Program2 %DIR%Program2 %KEY% Program3\installit.cmd Program3 %DIR%Program3 %KEY%I'm guessing this is not what you want, so please explain your requirements!
  19. How about a compiled batch file! [Edit] Just to qualify the post a little, this probably only works in English language versions and may not work pre-XP. Basically I made it for those occasions where the Local Administrator Name may have been changed. It therefore doesn't just use NET USER Administrator Pa5Sw0rdIt attempts to get the correct Local Administrator Name programatically and then does a little checking on the newly supplied password before setting it. [/Edit] RootPass.zip
  20. I would prefer ro use wmic, however the following should work @ECHO OFF&SETLOCAL ENABLEEXTENSIONS FOR /F "TOKENS=*" %%a IN ('REG QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList" /S^|FINDSTR "S-1-5-"') DO ( FOR /F "TOKENS=3 DELIMS= " %%b IN ('REG QUERY "%%~a" /V "ProfileImagePath"') DO ( IF ERRORLEVEL 0 ( ECHO/%%~b|FIND "%USERPROFILE%">NUL IF ERRORLEVEL 0 SET UserSID=%%a ) ) ) IF NOT DEFINED UserSID ECHO/ SID not found&&PAUSE&ENDLOCAL&GOTO :EOF SET UserSID=%UserSID:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\=% REG ADD HKU\%UserSID%\Software\Microsoft\Windows\CurrentVersion\Explorer\WebView\BarricadedFolders /V "shell:ControlPanelFolder" /T REG_DWORD /D 0 /F ECHO/ Your Registry Key was set using the following profile&ECHO/ %UserSID%&PAUSE&ENDLOCAL&GOTO :EOFwhere delims=<tab>
  21. How about a single line FOR /F "DELIMS=*" %%? IN ('DIR/B/S/AR "%~1"^2^>NUL') DO IF ERRORLEVEL 0 ATTRIB -R "%%?" /S /DUsage: readonly[.cmd] "x:\path to\dir"quotes only if spaces in path or file name
  22. @ reganetal %PASS:~0,1% would expand the PASS variable, and then use only the 1st character, (offset 0), of the expanded result. %PASS:~0,2% would expand the PASS variable, and then use only the 1st two characters, of the expanded result. etc... The loop continues until variable V=variable PASS, at this point, CNT2=number of characters The & character is replacing the 'carriage return' is the same as ECHO/ NOTE ECHO/ ¯¯¯¯ ECHO/ ECHO/ The First User added will be set as your Default User ECHO/ ECHO/ It will have Administrator Account privileges ECHO/ Finally I have changed no settings other than those you used, they are these lines NET USER "%NAME%" "%PASS%" /add NET LOCALGROUP "%UTYPE%s" "%NAME%" /add NET ACCOUNTS /maxpwage:unlimited REG ADD %REGKEY% /V DefaultUserName /D "%NAME%" /F REG ADD %REGKEY% /V DefaultPassword /D "%PASS%" /F IF /I %AUTLOG% EQU Y REG ADD %REGKEY% /V AutoAdminLogon /D 1 /F For testing purposes, just add ECHO/ as shown
  23. Well, the first thing I noticed was that your %path% variable, should not be named path and also points to the incorrect key. The %choice% variable would also be better renamed too! There is also very little error trapping which could cause many unforseen problems. Try using something like the example below, which is also attached. @ECHO OFF&SETLOCAL ENABLEEXTENSIONS&TITLE Account Creation SET /P TOADD= WOULD YOU LIKE TO ADD ADDITIONAL USERS (Y/N)? SET TOADD=%TOADD:~0,1% IF /I '%TOADD% NEQ 'Y ENDLOCAL&GOTO :EOF SET REGKEY="HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" SET CNT1=0 CLS&TITLE Account Name ECHO/ NOTE&ECHO/ ¯¯¯¯&ECHO/&ECHO/ The First User added will be set as your Default User&ECHO/&ECHO/ It will have Administrator Account privileges&ECHO/ :ADDNAME FOR %%? IN (NAME TIPE UTYPE PASS) DO (SET %%?=) ECHO/ PLEASE ENTER YOUR CHOSEN ACCOUNT (LOGIN) NAME SET /P NAME= IF "%NAME%" EQU "" ECHO/ Blank Names are not accepted!&&GOTO ADDNAME ECHO/&ECHO/ THE ACCOUNT NAME YOU HAVE CHOSEN IS&ECHO/&ECHO/ %NAME%&ECHO/&ECHO/ WOULD YOU LIKE TO CHANGE IT (Y/N)? SET /P ANSR= SET ANSR=%ANSR:~0,1% IF /I %ANSR% NEQ N GOTO ADDNAME NET USER|FIND /I " %NAME% ">NUL 2>&1&&(ECHO/&ECHO/ USER %NAME% ALREADY EXISTS&ECHO/&ECHO/ PLEASE TRY AGAIN&ECHO/&GOTO ADDNAME) CLS&TITLE Account Type IF %CNT1% EQU 0 SET UTYPE=Administrator&GOTO ADDPASS :ADDTYPE ECHO/ YOU CAN NOW CHOOSE AN ACCOUNT TYPE FOR %NAME%&ECHO/&ECHO/ Account Types&ECHO/ ¯¯¯¯¯¯¯¯¯¯¯¯¯&ECHO/ ECHO/ 1. Computer Administrator (less secure)&ECHO/ Has unrestricted access to the computer&ECHO/ ECHO/ 2. Power User (more secure)&ECHO/ Has only some restricted access to the computer&ECHO/ ECHO/ 3. Normal User (recommended)&ECHO/ Has restricted access to the computer&ECHO/ SET /P TIPE= Please enter your an account type for %NAME% (1/2/3): SET TIPE=%TIPE:~0,1% ECHO/%TIPE%|FINDSTR/R "[1-3]">NUL||GOTO ADDTYPE IF %TIPE% LSS 2 SET UTYPE=Administrator IF %TIPE% EQU 2 SET UTYPE=Power User IF %TIPE% GTR 2 SET UTYPE=User ECHO/&ECHO/ THE ACCOUNT TYPE YOU HAVE CHOSEN IS&ECHO/&ECHO/ %UTYPE%&ECHO/&ECHO/ WOULD YOU LIKE TO CHANGE IT (Y/N)? SET /P ANSR= SET ANSR=%ANSR:~0,1% IF /I %ANSR% NEQ N GOTO ADDTYPE CLS&TITLE Account Password :ADDPASS ECHO/ PLEASE ENTER A PASSWORD FOR %NAME%&ECHO/ ECHO/ NOTE&ECHO/ ¯¯¯¯&ECHO/&ECHO/ Passwords MUST contain a minimum of 6 characters&ECHO/ SET /P PASS= IF "%PASS%" EQU "" ECHO/&ECHO/ Blank Passwords are not accepted!&ECHO/&GOTO ADDPASS ECHO/%PASS%|FINDSTR/R "[^a-z,0-9,_,-]">NUL&&(ECHO/&ECHO/ Some of the characters you used were not acceptable!&ECHO/&GOTO ADDPASS) ECHO/&ECHO/ THE PASSWORD YOU HAVE CHOSEN FOR %NAME% IS&ECHO/&ECHO/ %PASS%&ECHO/&ECHO/ WOULD YOU LIKE TO CHANGE IT (Y/N)? SET /P ANSR= SET ANSR=%ANSR:~0,1% IF /I %ANSR% NEQ N GOTO ADDPASS SET CNT2=0 :LOOP SET /A CNT2+=1 CALL SET V=%%PASS:~0,%CNT2%%% IF "%V%" NEQ "%PASS%" GOTO LOOP IF %CNT2% LSS 6 ECHO/ Minimum Password length is 6 characters&ECHO/&ECHO/ Please try again!&ECHO/&GOTO ADDPASS CLS&TITLE Adding Account NET USER "%NAME%" "%PASS%" /add NET LOCALGROUP "%UTYPE%s" "%NAME%" /add IF %CNT1% EQU 0 CALL :DEFLOG SET /P ADDMORE= WOULD YOU LIKE TO ADD ANOTHER USER (Y/N)? SET %ADDMORE%=%ADDMORE:~0,1% IF /I %ADDMORE% EQU Y SET /A CNT1+=1&CLS&GOTO ADDNAME ECHO/&ECHO/ FINISHED ADDING USERS&ECHO/ ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯&ECHO/ NET ACCOUNTS /maxpwage:unlimited PING -n 4 127.0.0.1>NUL&ENDLOCAL&GOTO :EOF :DEFLOG REG ADD %REGKEY% /V DefaultUserName /D "%NAME%" /F REG ADD %REGKEY% /V DefaultPassword /D "%PASS%" /F SET /P AUTLOG= Would you like %NAME%s Account to Logon Automatically (Y/N)? SET AUTLOG=%AUTLOG:~0,1% IF /I %AUTLOG% EQU Y REG ADD %REGKEY% /V AutoAdminLogon /D 1 /F GOTO :EOF AddUser.zip
×
×
  • Create New...