• Content count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About Scr1ptW1zard

Contact Methods

  • Website URL
  1. I would suggest you rethink your strategy on this. Your goal is to determine if ALL your servers can communicate with the KMS. This communication is performed over port 1688 (by default) and a ping request will not test for this. Take a look here http://technet.micro...y/ee939272.aspx for more troubleshooting information.
  2. crobertson, Are you looking to create a file containing the customer information contained in the variable (%destination%) and the list of installed applications? If so, perhaps this will work for you: @Echo off set destination=%date% - My Customer type nul>.\apps.txt type nul>.\sorted.txt for /f "tokens=2,*" %%a in ('Reg Query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall /S^|find " DisplayName"') do ( echo "%%b"|findstr /B /V /C:"Hotfix"|findstr /B /V /C:"Security Update"|findstr /B /V /C:"Update">>.\apps.txt ) sort .\apps.txt /o .\sorted.txt echo %destination%>.\destination.txt >nul copy .\destination.txt+.\sorted.txt .\backup.txt If this is not correct, please rephrase your question to explain exactly what you are looking for.
  3. I do not have a DOS system to test this on, only a Windows 7 command prompt (cmd.exe). This will do for the specific conditions you have listed. Changes will need to be made if any of the pet names will have spaces. @echo off Set Pets=Cats Dogs Horses Set Cats=FiFi FruFru Fluffy Set Dogs=Lassie MrMuggies RinTinTin Set Horses=MrEd Trigger For %%a In (%Pets%) Do ( For /f "Tokens=1,* delims== " %%b In ('set %%a') Do ( For %%n In (%%c) Do ( Echo %%a %%n ) ) )
  4. AceInfinity, Yzöwl is providing valuable feedback. Perhaps you meant to ask "How could this be done more efficiently?" In that case, here is some changes I would make: For the checking of command-line parameters, ask yourself "What do I need as input?" Your answer would be "at least 2 parameters". So, just check for that: if [%2] equ [] goto noArgs You can also do away with most of the variables. Set "original=%1" :start shift if [%1] equ [] goto :eof >>"bin_output\results.txt" fc /b %original% %1 goto start HTH
  5. Actually, to only list *.pdf files, you would need to modify the "dir" command line syntax that is listing the files. In the script, I have the following command line that is listing all files in a given directory: dir "%fldr%" /a-d /b What this is stating is "list all items in a bare, just display the file name, format (/b ) that are not directories (/a-d) in the specified directory (%fldr%)" To only show .pdf files, you would need to modify this command to the following: dir "%fldr%\*.pdf" /a-d /b To get a better understanding of what these command lines are doing, open a command prompt and run them from there, changing the %fldr% to a valid path. Something like this: dir "%userprofile%\documents\*.pdf" /a-d /b For a full list of command line switches for the 'dir' command, run dir /? at the command prompt. And if you want more information on what the "tokens=*" is, look at the help for the "for" command: ( for /? ) So, your new batch file would look like this: @echo off ::Change this variable to the directory containing the files Set "fldr=D:\Your Files Location" for /f "tokens=*" %%a in ('dir "%fldr%\*.pdf" /a-d /b') do md "%fldr%\%%~na"&move "%fldr%\%%a" "%fldr%\%%~na"
  6. This will create the folders in the same directory as the files you are working against. @echo off ::Change this variable to the directory containing the files Set "fldr=D:\Your Files Location" for /f "tokens=*" %%a in ('dir "%fldr%" /a-d /b') do md "%fldr%\%%~na"&move "%fldr%\%%a" "%fldr%\%%~na"
  7. Not sure if this is it, but try changing: <Group>Administrator</Group> to <Group>Administrators</Group>
  8. There are a couple a ways to do this: Option 1: Assuming the computer name is the label you are calling, as you wrote in your request. Change: if "%COMPUTERNAME%" == "Test" goto :TEST To: call :%COMPUTERNAME% goto :eof Option 2: Using the logic flow as you wrote it. Change: if "%COMPUTERNAME%" == "Test" goto :TEST To: if /i "%COMPUTERNAME%" == "Test" goto :TEST goto :eof Option 3: Exit the script when the condition does not match. Change: if "%COMPUTERNAME%" == "Test" goto :TEST To: if /i "%COMPUTERNAME%" NEQ "Test" goto :eof HTH
  9. Try this: If MsgBox( _ "Run New Process Notifier?",4132,"New Process Notifier") = 6 Then CreateObject("Wscript.Shell").Run("""C:\Program Files\New Process Notifier\NewProcessNotifier.exe"""),1,False End If Spaces in the path/file names require additional quotes.
  10. You did say you want to move all files up one level right? Here is how I would do that: @echo off ::Change the environment variable on the next line to the directory you want to move Set "movePath=D:\Temp\one" move "%movePath%" "%movePath%\..\.." This will move the folder "D:\Temp\one" and all sub folders and files to "D:\". So you will end up with "D:\one" and all sub directories.
  11. I believe this has to do with Novell's digital certificate. I have an unattended installation of this client working, although I am not using WPI. Prior to running your command to install the client, you will need to install the Novell certificate. I am using the following commands to accomplish this: certmgr.exe -add Novell.cer -c -s -r localMachine Root certmgr.exe -add Novell.cer -c -s -r localMachine TrustedPublisher You may have to specify the full paths for both certmgr.exe and Novell.cer, I placed both these files in my installation folder to make life easier.
  12. Based on your example, and the solution you had already found, try this: @echo off set /p var=text...<nul start /wait setup.exe ECHO Done!
  13. I use a .hta as my shell under WinPE also. You can add these lines: Set objWShell = CreateObject("WScript.Shell") objWShell.Run "cmd.exe %systemroot%\system32\diskpart.exe /s %systemroot%\system32\ospart.txt",0,True to your InstallOS.hta and set the shell (in winpesh.ini) like this: [LaunchApps] %SystemRoot%\System32\wpeinit.exe %SystemRoot%\System32\mshta.exe, %SystemRoot%\System32\InstallOS.hta
  14. Something like this? Batch file: @echo off :: batch code ::Prompt here cscript //nologo question.vbs if errorlevel 1 goto XY2 goto XY1 :XY1 echo You have chosen yes. goto :eof :XY2 echo You have chosen no. goto :eof VBScript file: Option Explicit Dim oShell, retCode Set oShell = WScript.CreateObject("WScript.Shell") retCode = oShell.Popup("Place your question here?", 30, "Title", 4 + 32) Select Case retCode case 6, -1 WScript.quit(0) 'Yes or time-out was chosen case 7 WScript.quit(1) 'No was chosen End Select This assumes both files are located in the same directory. Change the text you want displayed to the user. The vb script uses the quit method of wscript to provide an exit code that the batch file can use with an errorlevel check to determine what was chosen.
  15. "/wait" is not a valid switch for the copy command. You also have is elsewhere in your script as well as with the del command.