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. Since we have a member already providing you with scripted help, the following script is posted only as an example. @ECHO OFF&SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION FOR /R %%# IN (*-KB*.MSU) DO (CALL :SUB %%~n# ECHO= INSTALLING KB!_!&ECHO=WUSA "%%#" /QUIET /NORESTART) PAUSE&GOTO :EOF :SUB SET "_=%*" FOR /F "DELIMS=-" %%$ IN ("%_:*-KB=%") DO SET "_=%%$"It does answer your second question but may not perform to your exact requirements.
  2. That batch file you were provided with could not have installed all of your .msu files in that folder, silently or otherwise! It skipped the first .msu file, because the code is wrong. I've already told you why it skipped the first file, so just remove that request from the code and it will be instantly better.
  3. When your code does a directory listing of *.msu files, the first result, alphabetically by default, is deliberately being ignored and therefore not processed, (skip=1). Additional note, please use correct English, not text speak, it helps our non English speakers to follow the conversations better.
  4. have you thought of changing the code to read Set objShell = CreateObject("WScript.Shell") objShell.Run Chr(34) & "N:\Shared\TOandPGI\TOCounter.vbs" & Chr(34) The error code I think means The system cannot find the path specified. therefore if the additional double quotes doesn't work then I'd suggest you check that the path is actually correct, (most likely an incorrect shared drive letter).
  5. I've seen this code here before, and never really got round to mentioning it, why are you not installing all of the .msu files in that directory?
  6. As a result of the Developers hesitance in helping, I'm going to close this Topic
  7. Please note, do not post another message when you haven't received a response after only forty minutes, it's rude.
  8. Are you sure that you are not wanting something in the range of 172.16.0.x with a Subnet Mask of 255.240.0.0? It was my understanding that the IP range 172.16.0.0 - 172.31.255.255 uses the default mask of 255.240.0.0. Also as seems to be common around here lately, this is not a script request forum, please make an attempt at the script and provide full information in order to get help, advice or information.
  9. Both of these 'Tasks' are 'Services' if you change the 'Startup type' to 'Manual' instead of 'Automatic' they will only start up if needed. You can access the particular services by 'entering' the following in the Start Menu Search box: SERVICES.MSC. Scroll to the services you are wishing to change, right-click on them and change the 'Startup type' accordingly.
  10. There are some files and directories placed inside the Temp location for use by other some processes, they are not what you want to delete, so why do it? Your installers should remove their own temporary files as part of the installation routine. If they do not then the most responsible idea would be to remove all files and directories which have been added only by that routine. For that you would need to do either a before and after compare or ensure that the installation files are all placed within a unique directory which can then be deleted after installation without affecting others. You will then likely find that you will not be deleting any in use files since the ones you need to remove are not in use and they can be deleted with a simple command without rebooting.
  11. The code was pointless because you used a FOR loop to generate three variables, (%%A, %%B and %%C), then proceeded not to use or reference them. I'll explain with a batch file you can run to see: @ECHO OFF SETLOCAL ENABLEEXTENSIONS (SET MYDATE=FRI 04/22/2011) ECHO=%%MYDATE%%=%MYDATE% ECHO= ECHO=GET THE LAST FOUR CHARACTERS OF %%MYDATE%% ECHO=%MYDATE:~-4% ECHO=THE YEAR IS DISPLAYED ABOVE ECHO= ECHO=GET THE FIRST TWO OF THE LAST TEN CHARACTERS OF %%MYDATE%% ECHO=%MYDATE:~-10,2% ECHO=THE MONTH IS DISPLAYED ABOVE ECHO= ECHO=GET THE FIRST TWO OF THE LAST SEVEN CHARACTERS OF %%MYDATE%% ECHO=%MYDATE:~-7,2% ECHO=THE DAY IS DISPLAYED ABOVE ECHO= PAUSENow if you try the code again by replacing the date in 'SET MYDATE' with just 04/22/2011 you should get the same results.
  12. @ jamesbebby There is no need to ever delete the %TEMP% directory, what you should be doing, although it shouldn't be necessary since your installer(s) should do it, is deleting specific files and /or folders within the %TEMP% location.
  13. There are a few things I'd like to mention. The first is this pointless code: @For /F "tokens=1,2,3 delims=/ " %%A in ('Date /t') do @( Set FileDate=%date:~10%%date:~4,2%%date:~7,2%)when this is all you used: @SET FileDate=%DATE:~10%%DATE:~4,2%%DATE:~7,2%There is no need at all to use the /Q switch with your DEL command and I'd strongly suspect that because your writing the file yourself it will also not be read only and will therefore not need the /F switch. Don't use labels in your file which can be confused as commands i.e. START Is there a particular reason why you turned ECHOing back ON? Be aware that your method of creating dates to your preferred format is not going to be the same on all systems. BTW, if your code is used only on systems consistent with the same date order it does not mean that they will all include the day at the beginning. For this reason I'd suggest you use the following idea to formulate the required output. %DATE:~-4%%DATE:~-10,2%%DATE:~-7,2%(It works from the back of the date thus ignoring the possibility of something tagged to the beginning.)
  14. Its no good providing a command line for XP (with service pack 2) if users of previous operating systems could potentially install the application. The parsing of output from commands such as DIR can change according to the OS, FSUTIL is not available on all OS's. What is your application, it will very likely already have been coded to check for disk space as part of it's routine?
  15. So which Operating system(s) is your application compatible with?
  16. Since you are working in kilobytes you would need to multiply your gigabytes figure by 1048576 and use that for your check. i.e. 50 GB x 1048576 = 52428800 kB (As you can see, in this case your 59451776 kB is sufficient to accomodate your requirements) Please note that you should never fill a hard disk to capacity, (you may be advised to allow for extra as a safety factor)
  17. I'd suggest that you would enter the amount of space you require to have free as a parameter and the utility would return 0 for yes and 1 for no. If your question is not a mistake you will need to bear in mind that some methods of checking on MS-DOS 5 will suffer at 1Gb and completely fail at over 2Gb. 1Gb does seem like a very large requirement for that Operating System. I think that the standard method of manually checking free disk space was to issue chkdsk [drive]:
  18. Do you mean that instead of using this, you'd prefer something a little more like this?
  19. As a result of the formatting error on the above post, I thought I'd post it again, this time concatenating the line which required it. If MsgBox("Run New Process Notifier?",4132,"New Process Notifier") = 6 Then CreateObject("Wscript.Shell").Run(Chr(34) & "C:\Program Files\" & _ "New Process Notifier\NewProcessNotifier.exe" & Chr(34)),1,False End If
  20. Scr1ptW1zard, my understanding was to move all files within the tree below the current directory up to the current directory, yours appears to move directories too. FOR /R %%# IN (*.*) DO MOVE "%%#"
  21. You don't really need to 'crack' the password, (find out what the password is), unlesss you're using drive encryption. What you should do is simply blank the password, to do this I'd suggest using Kon-Boot (for x86 systems only) or Offline NT Password & Registry Editor. Please bear in mind that your son may be capable of using the same tool to enter the system and change the parental controls too!
  22. Since the first script is only a sample and there are errors in it you will need to post up all of it in order to ensure that it will run. The second script has also got more than one error too. It may even be prudent to post up the PermissionFile, TaskSchedule and CleanUp batch files too.
  23. Which version of WinRAR are you using? I believe that 'Extract relative paths' is now the default extraction mode in version 4.00, if you are using a previous version you may need to look at the -ep switch.
  24. For something very basic then packaging the script within a self extracting archive may suffice, a dedicated utility may give you a little more in the way of features but not much. As a rule I'd suggest that writing a batch file, and wrapping it into an executable, (they are not really compiled just hidden within something else), would be pointless for the most purposes. Let us know what exactly you are doing and we may be able to suggest a more appropriate method of achieving what you need, possibly a hta or autoit script.
  25. Thats because there was still a formatting problem, here it is again fixed. strComputer = inputbox("Type a computer name","Enter computer name") if strComputer = "" then strComputer = "." On Error Resume Next Const wbemFlagReturnImmediately = &h10 Const wbemFlagForwardOnly = &h20 WScript.Echo WScript.Echo "==========================================" WScript.Echo "Computer: " & strComputer WScript.Echo "==========================================" Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2") Set colItems = _ objWMIService.ExecQuery("SELECT * FROM Win32_ComputerSystem", "WQL", _ wbemFlagReturnImmediately + wbemFlagForwardOnly) For Each objItem In colItems WScript.Echo "Manufacturer: " & objItem.Manufacturer WScript.Echo "Model: " & objItem.Model Next
×
×
  • Create New...