Jump to content

Rez.

Member
  • Posts

    38
  • Joined

  • Last visited

  • Donations

    $0.00 
  • Country

    Canada

Posts posted by Rez.

  1. Hi.

    I'm trying to write a batch script that checks to see if previously imported Registry settings succeeded. Here is the code I have so far:

    @echo offtitle %~nx0echo.SETLOCAL enabledelayedexpansionFOR %%I IN (HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced) DO (FOR %%J IN (HideIcons SharingWizardOn) DO (FOR /F "tokens=3 delims= " %%K IN ('reg query %%I /v %%J') DO (IF !ERRORLEVEL! EQU 0 (echo successful) ELSE (echo Error)))))PAUSEEXIT

    The second parameter in the second loop is there by design. I wanted the script to be able to handle missing keys. The ERRORLEVEL portion works fine when the key exists and is set to 0, allowing the IF statement to do it's thing. When it hits a non existent key, Reg Query spits out an error as you would expect but the ERRORLEVEL is not set. I know this because I placed an ECHO command between the second loop and the IF statement and it just gets ignored on the second iteration. The IF statement is not executed at all.

    I've tried various different things. I've used IF ERRORLEVEL 0, IF !ERRORLEVEL! EQU 1/0 ... etc. Every combination I could think of. I've checked the reg query command on it's own and it seems to set the Errorlevels correctly outside a loop. 0 for success and 1 for a fail. Can anyone tell me what I'm doing wrong? Or atleast point me in the right direction. I've been reading for two days now and am no closer to the answer. Thanks for reading.

    Here is a screenshot of the script being executed:

    post-95842-0-28774600-1392474354_thumb.p

  2. 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=)

    Yes, You see I initially thought the system I was working on had a MM/DD/YY date format. Turns out Canadians use the same date format as the English. Your code is very interesting. I do know about those special variables (They were my first choice) But I could not get my first approach to work. It looked like this:


    echo Regsettings-Results: > RegSettings-Results(%DATE).log

    That always threw a The system cannot find the path specified error. I just modified the above using your example and it works. :thumbup


    echo RegSettings-Results: > RegSettings-Results(%DATE:/=-%).log

    Can you tell me exactly what the :/=- part is - Does? The links left by Jaclaz seem to indicate that they are assignment operators but I don't understand why I need them in the %DATE% variable.

    At any rate this has been a very informative thread for me, Thank you both for taking the time. Have a good weekend.

  3. Ok first off, Sorry for the late reply. I could of swore I replied to Jaclaz this afternoon.

    After looking at the link left by Jaclaz - I finally got it to work. As fas as I understand the variable I was trying to set in the FOR command was expanding too early.

    I fixed the script by adding SETLOCAL EnableDelayedExpansion at the start of the script and then changing the FOR statement to this:


    REM Creating script log

    :CREATELOG
    For /F "tokens=1,2,3 delims=/" %%M IN ('echo %DATE%') DO set LOG=RegSettings-Results(%%M-%%N-%%O).log && echo RegSettings-Results: > "%LOGPATH%\!LOG!" && echo. >> "%LOGPATH%\!LOG!"

    It now works fine. No errors at all and the Log file is created in the path I specified. Thanks so much to both of you. :D

  4. Hi,

    Going to try and make a long story short here. I'm importing a bunch of Reg files and would like to have a log of what installed and what didn't. I'm having a problem with coming up with a way that creates said log.

    Here is what I have:

    FOR /F "tokens=1,2,3 delims=/" %M IN ('date /t') DO set LOG=RegSettings-BSPResults(%N-%M-%O).log && echo RegSettings Results: > "%LOGPATH%\%LOG%" && echo. >> "%LOGPATH%\%LOG%"

    The above works fine on the command line. It creates a Log file with the appropriate date stamp in the file name at the specified location. When I try the same line of code (with the appropriate meassures taken in regards to paramaeters, It throws an error saying it cannot find the path specified. No files are created and at the end of the file name it seems to insert a space at the end of the name but before the extension. Here's what the code looks like in a batch file:

    FOR /F "tokens=1,2,3 delims=/" %%M IN ('date /t') DO set LOG=RegSettings-BSPResults(%%N-%%M-%%O).log && echo RegSettings Results: > "%LOGPATH%\%LOG%" && echo. >> "%LOGPATH%\%LOG%"

    Here is what I get:

    The system cannot find the path specified.
    LOG=RegSettings-BSPResults(11-05-2010 ).log
    D:\unattended\Logs\RegSettings-BSPResults(11-05-2010 ).log
    Press any key to continue . . .

    Can anyone help me find out what's going on? I've tried everything I can think of but I guess this is way beyond me. Probably something silly I've overlooked.

    Thanks.

  5. Hi.

    I need to ask a question about Sysprep and the use of unattend.xml. I would like to build a universal syspreped image of Windows 7 Ultimate and then use a different Unattend.xml to deploy it to different machines with different requirments. I've been reading this guide over at Brian Lee Jackson's Blog and have a few questions I can't seem to find the answer to.

    It says to create an Unattend.xml file and place it in the Sysprep folder and then refer to it explicitly when resealing using the following command :

    sysprep /generalize /oobe /shutdown /unattend:unattend.xml

    The unattend contains a reference to the CopyProfile attribute that will copy the logged in profile to the Default profile. This is what I need. However, What I don't understand is when the Unnatend file is executed. If I create a new unnatend file and put it on let's say a USB drive. Will setup pick it up instead of the one in the Sysprep folder? If it does will I have to set the copyprofile attribute again in the new Unattend file or will it pick up that setting from the Unnatend in the Sysprep folder? I've searched and found some information but I'll be honest, It confused me even more. Any help would appreciated.

    Thanks.

  6. Hi and thank you for replying.

    I'm not sure what you mean when you say "Two options for RDP". RDP actually works. I can connect to the remote computer via RDP, Pull up an elevated command prompt and execute the shutdown command from there. That works.

    What I can't do is pull up an elevated command prompt and simply execute the same command: shutdown -m \\Computername -s -f . Where would I find the option to select secure mode vs classic mode? I'm also not sure how to add a user from one computer to the Administrator group of another. Any tips? Thanks again for responding.

  7. Hi-

    I've recently made the switch to Windows 7 from XP and I'm having trouble shutting down a remote computer via the command-line using the Shutdown command.

    Everytime I use the shutdown command, I get a "Access is denied.(5)" error. I've been searching Google for the better part of 10 Days and have tried multiple soloutions, None of them have worked so far.

    Here's the setup: Two computers both running Windows 7 Ultimate networked together over a Wireless Network. I can successfully ping both computers over the network and I can access all my shares on both Computers. Both computers have the same named user account and password, And both accounts are administrators.

    - Using psshutdown I get an Access is denied error (Even if i use the -u and -p switches to supply user account info).

    - Added the User accounts to Local Security Policy > Local Policies > User Rights Assignments > Force shutdown from a remote system on both computers.

    - Made sure that Local Security Policy > Local Policies > Security Options > Network access: Sharing and security model for local accounts is set to Classic.

    - Disabled the Windows Firewall on both computers.

    + I do not have any Anti-virus or 3rd party Firewalls on either system.

    I really need this feature which worked fine in XP. All the answers I've come across seem to point to a privilege problem somewhere, I just can't figure out where. Please, Any input would be appreciated at this stage - Sorry for the long post and thanks for reading.

  8. Hi.

    Don't mean to bump the thread - Just thought I'd post here instead of creating a new one.

    Is there anyway to get the SCRIPT_FILE switch to work with relative paths? In avg 7.5 Free I could set the path to the config ini file using relative paths - No such luck with 8.5.

    In way of example:

    D:\
    +AVG
    - avg.exe
    - avg_cfg.ini

    In 7.5 I could use the following command:

    start /wait avg.exe /SCRIPT_FILE \avg\avg_cfg.ini

    In 8.5 I get a Script cannot be parsed error and have to use the absoloute path.

    Any ideas??

    Thanks.

  9. Hi,

    I have been doing Unattended setups for a few years now and there has always been one Reg Tweak that has never worked for me. It's mentioned in countless tweak guides and concerns itself with enabling/disabling the Common Tasks portion of explorer in Windows XP aka webview.

    The evoloution of this tweak for me has been as follows:

    In an HKCU.reg file imported at T12 via commandlines.txt:

    ;	Do not use Common Folder Tasks
    [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced]
    "WebView"=dword:00000000

    The above never stuck.

    The following keys were imported via HKCU.reg at T12 and HKLM.reg on first run:

    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\WebView]
    "DefaultValue"=dword:00000000
    [HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\WebView]
    "DefaultApplied"=dword:00000000
    [HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced]
    "WebView"=dword:00000000

    This also never worked.

    And finally, After studying what nLite did when using it's Tweak section I finally decided to integrate the tweaks directly into hivesys.inf and hivedef.inf:

    HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\WebView","DefaultValue",0x00010001,0
    HKCU,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\WebView","DefaultApplied",0x00010001,0
    HKCU,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced","WebView",0x00010001,0

    This also does not work.

    I guess it's just bugging me that it is always mentioned as a valid reg tweak but never seems to work out for me.

    Any opinions would be appreciated.

    ~Using Windows XP Professional XP SP3

    Thanks for reading.

  10. Hi.

    I'm currently dual booting Windows XP Pro and OS X Leopard on my system. I recently installed Paragon NTFS to gain write access to my NTFS partitions. All is well so far with the exception of one annoying problem. Every OS X session leaves behind some files on my NTFS partitions (.Trashes, ._.Trashes ..etc) This happens everytime I boot back into XP from OS X. I can delete these junk folders and files from Explorer without incident so I thought I would write up a little Batch Script to do it for me at Startup.

    Given it's unix nature, The OS X files all start with what XP would consider illegal characters namely periods. I can delete the offending folders from the commandline without any problems but the files always come back with a "File not found" error. I've searched around and can't seem to find out why this is. I also cannot rename or move the offending files from the commandline.

    Here's what I mean in way of an example:

    @echo off
    title Cleaning up OS X junk files

    echo.

    echo Cleaning up OS X junk files ...

    RD /Q /S %SYSTEMDRIVE%\.Trashes

    REM The Removal of the Folder named .Trashes is successful

    del /Q %SYSTEMDRIVE%\._.Trashes

    REM Comes back with an error telling me it cannot find the file specified
    REM The MOVE and RENAME commands give the same message

    Note that I can delete all files and folder starting with illegal characters from Explorer.

    Any help would be appreciated - Thanks. :thumbup

  11. Hi.

    I'm having a really hard time trying to get this to install. I'm trying to install After Effects only without any of the crap that gets installed with it (Bridge, Version Cue ... etc) I deleted everything in the "<Requires></Requires> tags including the tags themselves. However, When trying to install I don't get these packages as selectable options.

    I tried just taking what I needed and do a seperate package but everytime I try to install I get a "Please Insert CD names bla bla into drive F:".

    Help??

  12. Hi all.

    I'm having a really weird problem installing Hotfixes via SVCPACK during a Windows XP SP2 Install. After having nlited this particular install (And after adding all relevent Hotfixes to SVCPACK and creating a new SVCPACK.inf file), I tested it out in VMware and the install went smoothly. I then installed and ran QFECHECK as I always do and it came back with a "This hotfix should be reinstalled" error on Thirteen of the Hotfixes.

    I retested the installation after making one adjustment, I installed with SFC disabled and ran QFECHECK again with the same results as before. This time I ran QFECHECK in verbose mode and got a list of the files that seemed to be failing. They all seem to be located in the DLL cache, So I compared the DLL version numbers from those in the Source to those in System32 to those in the DLL cache. The results were as follows:

    The DLLs located in the system32 Directory were of a higher version number (And thus assume are the updated versions) than the DLLs found in both the DLL cache and the Source disk. In addition, the version numbers for those DLLs found in both the DLL cache and the source were identical.

    I've been googling for the past 2 days and it is my understanding that sometimes a Hotfix will not update the security catalouge which in turn does not update the DLL cache - QFECHECK checks a DLL to the version stored in the DLL cache and if their is a mismatch - It throws an error. I could be completley wrong but I haven't been able to find alot that deals with this. On a whim I deleted the contents of the DLL cache (Since SFC is now tuned off) and then ran QFECHECK once again - It came back with not a single error. Also, The error related Hotfixes are listed as installed in Add/Remove Programs. Unfortunately as of now I am unable to connect to the Net from VMware (Still working on as to why) so I can't check with Windows Update to see if these updates are listed as hotfixes that need to be installed.

    Is it safe to assume that the Hotfixes are actually running on my system? Running a system without SFC is ok right now (Since I always have SFC disabled) but what will happen if I need to keep it enabled (On a clients machine)? Will SFC wipe away the updated DLL and replace it with older ones in it's cache? Has anyone else ever had the same problem? Questions Questions I know I know. Can anyone shed some light on this matter? Thank you in advance and sorry for such a long post.

    Here is a copy of the QFECHECK log.

    REZ270777.log.txt

  13. Hi

    I've been searching for awhile on a way to prevent various Applications from changing file extensions in XP.

    So far, I've not been able to find anything and Gpedit has yielded little in control over Extensions. Is their perhaps a

    Reg file or setting somewhere in XP that locks out HKEY_CLASSES_ROOT from being changed by applications?? I've only

    found one piece of software on the Net called "Associate this" but it is payware (Something I'm not prepared for at the moment).

    I really would like a built in soloution if there actually is one - Or perhaps a no bells freeware that prevents Apps from changing

    extensions?? Any help would be appreciated ...

    Thanks for reading.

    PS: I'm using XP Pro SP2.

  14. Hi.

    Does anyone remember an old Tweak back in Windows 98 that changed Windows Explorer's "Zone" title and icon to anything you wanted? The Registry value was

    HKEY_CURRENT_USER/SOFTWARE/MICROSOFT/WINDOWS/CURRENTVERSION/INTERNET SETTINGS/ZONES/0

    Well I tried this hack out on XP Pro SP2 but nothing happens. There is an identical key at HKLM too and I changed that too match the one in HKCU, But still no change.

    Anyone know if there is something else I can do to get this working??

    Thanks.

  15. Hello,

    I'm having a problem with silent installs of Dreamweaver/Flash 8.0 . Both installers are in MSI format. For the most part, A simple transform works for installing both Programs silently. My problem stems from the fact that I want to install the Programs to :

    ProgramFiles\Flash

    and

    ProgramFiles\Dreamweaver

    The default install path for both Programs are :

    ProgramFiles\Macromedia\Flash 8

    and

    ProgramFiles\Macromedia\Dreamweaver 8

    During the creation of an MST, I can only change the 'Macromedia' Part of the install path. That is to say no matter what I do I can only get the Programs to install in a path like the Following :

    ProgramFiles\AnyFolderName\Dreamweaver 8

    I have tried editing the MSI with Wise Package Studio. My method was to set a new install path by going to

    Installation Expert > Product Details > Default Directory. I click on the dropdown box and select 'Program Files' Then click on 'New Folder' and type 'Flash'. This gives me a new Install Directory of ProgramFiles\Flash. I also make sure that the option "Change Feature Configurable Directories" is Checked and then Compile. The Recompile always throws up errors and when it doesn't the MSI stops halfway through the install proccess with an Internal Error 2356 Cabs.m2 Error and quits.

    Another thing to note is that although the edited installer shows the edited install path, If I click on browse it is still set to it's old install location.

    Any help would be appreciated, even a nudge in the right direction would be appreciated. Thank you for reading ....

  16. Hi ..

    I'm really on a roll with silently installing all my applications and have now moved on to trying to silently install 'Installshield' type installations. I'm having a strange problem when trying to install 'WinDVD 7.0'. It's and Installshield type install file with a .exe extension. If I install it normally, I get the usual dialouge boxes in the following order : Welcome, Licence agreement, Destination folder, Startmenu Folder and two options dialouge boxes. If I use the -R switch to get a setup.iss file, I don't get an option to select where I want to install the program. Because of this WinDVD installs using its default path which is %ProgramFiles%\Intervideo\DVD7 and Common.

    I took a look at the setup.iss file and it doesn't have an entry like 'AskDestPath' or even 'sdAskDestPath'. I tried to reorder the 'dlg' entries and add the 'sdAskDestPath' entry manually but it still installs to the above mentioned default path. I've tried everything I can think of to install the program to where i want it to be silently but no Cigar.

    Has anyone had any luck getting this program to show the 'Select Dir' option in -R mode? Or maybe got it to happen manually editing the setup.iss file? Is this just the way the good folks over at Intervideo scripted their installer?

    Any ideas? Suggestions?

    Thanks.

  17. I've already visited that link http://www.msfn.org/board/index.php?showtopic=18860 But didn't get much out of it since Mazin was talking mainly about modifying the actual MSI. Your first link however is interesting. I enjoyed reading the comparison between Wise and Installshield.

    Maybe one day when I've saved a few thousand dollars, I can buy these programs and continue with my dream of applying Transforms to my .msi files ... :whistle:

    Thanks for the reply ...

  18. Hi ..

    I would say a good 80% of all my apps are in .msi format, And i would love to be able to silently install them all with a batch file. One of my problems is that I never use %ProgramFiles% which is the default location for most installers. I looked up .msi switches but couldn't find a switch to set my prefered install location. I also couldn't find a switch to include a Serial number.

    A Little more reading and I stumbled upon the concept of MST (Transfrom) Files. They seem to be just what I am looking for, a way to modify the install without having to modify the actual .msi ... That's where things go South for me. I can't seem to find any information on how to create an MST. After about an hour of searching, I came across a free program called 'Installtailor' but the link was dead and apparently has ended up being incorporated into Wise Installer.

    I guess the real question for me is, What do I use to create MST files? Can anyone give me any recomendations?

    Thanks ..

  19. I did some more searching around last night and came across some interesting info. You guys are all correct that I was hasty thinking it wasn't totally a hardware problem. I came across this last night link which lead to this link and it's all pointing to either a hardware conflict or perhaps the computer is underpowered. I recently had to swap out my power supply for a lower rated one and it's powering an AMD64 proccessor and motherboard.

    So, i guess it's up to me to see where the hardware is failing ... Thanks for all the replies guys/gals

    For anyone with the same problem, Here's what I found.

    An explanation of what's going on and a possible soloution

    Thanks again.



×
×
  • Create New...