Content Type
Profiles
Forums
Events
Everything posted by Yzöwl
-
The following is what I used to use on XP systems. strComputer = "." Set objWMISvc = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\default") Set objItem = objWMISvc.Get("SystemRestore") errResults = objItem.Disable("")Disabling the service essentially prevents the System Restore on all drives. Changing the last word to Enable would obviusly reverse the action. Here's one which will cover both scenarios 'Enable or Disable System Restore strComputer = InputBox("Enter the COMPUTER NAME or the IP ADDRESS of the " _ & "system on which you would like to Enable or Disable System Restore. " _ & vbCRLF & "(use localhost for current system)", "Remotely Enable or " _ & "Disable System Restore","localhost") If strComputer = "" Then WScript.Quit End If strChoice = Inputbox ("System Restore:" & vbCrLf & vbCrLf & "1: Enable" _ & vbCrLf & "2: Disable" & vbCrLf & vbCrLf & vbCrLf & "Please enter 1 or 2 " _ & "(leave blank to quit):", "Enter 1 to Enable or 2 to Disable","") If strChoice = "" Then WScript.Quit End If If strChoice = 1 Then Set objWMISvc = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\default") Set objItem = objWMISvc.Get("SystemRestore") errResults = objItem.Enable("") Mybox = MsgBox("System Restore is now enabled on " & strComputer & "" _ & vbCRLF ,vbOkOnly,"System Restore Enabled") End If If strChoice = 2 Then Set objWMISvc = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\default") Set objItem = objWMISvc.Get("SystemRestore") errResults = objItem.Disable("") Mybox = MsgBox("System Restore is now disabled on " & strComputer & "" _ & vbCRLF ,vbOkOnly,"System Restore Disabled") End If
-
ROBOCOPY using batch
Yzöwl replied to Caml Light's topic in Programming (C++, Delphi, VB/VBS, CMD/batch, etc.)
There's no reason why you cannot use the DISM command replacing %~dp0 with "%_:~,-1%". You shouldn't need the RD command ife you're running it from optical media which is read only. -
ROBOCOPY using batch
Yzöwl replied to Caml Light's topic in Programming (C++, Delphi, VB/VBS, CMD/batch, etc.)
@ECHO OFF & SETLOCAL ENABLEEXTENSIONS SET "_=%~dp0" ROBOCOPY "%_:~,-1%" "%SystemDrive%" file1.ext file2.ext -
The following should be sufficient although it does seem a little pointless not knowing how many separate instances of a process are running. @ECHO OFF >processes.log TYPE NUL FOR /F "DELIMS=," %%# IN ('TASKLIST /FO "CSV" /NH') DO ( >NUL FINDSTR/IBE "%%~#" processes.log||>>processes.log ECHO=%%~#)Please note that cmd.exe, conhost.exe and tasklist.exe may be included only as a result of your query, but since there is no way of knowing I'd be inclined not to remove them from the logged results.
-
How would this do for your needs: @ECHO OFF >PROCESSES.TXT TYPE NUL FOR /F "DELIMS=," %%# IN ('TASKLIST /FI "STATUS eq RUNNING" /FO "CSV" /NH') DO ( >>PROCESSES.TXT ECHO=%%~#)
-
Using batch to add to the registry
Yzöwl replied to al1290's topic in Programming (C++, Delphi, VB/VBS, CMD/batch, etc.)
The value you've provided for the ControlFlags is for the enabled adaptor, (the disabled value should be dword:0f910002 or "261160962") I would suggest that in order to perform the task you'd need to Query the value in the registry and check if disabled using your known values. If the value shows disabledcheck if the Windows Zero Configuration Service is running and stop it if it is. Apply the known value to the registry. Start/restart the WZC service -
File modified date problem in makecab.exe 5.1.2600.5512
Yzöwl replied to Explorer09's topic in HFSLIP
It may be a bug however it is not something which I can see of any concern to HFSLIP users. BTW, some older versions of expand cannot uncompress an LZX cabbed file so you may need to use MSZIP compression in order to remain compatible. -
Create Rar based on file size
Yzöwl replied to gocool's topic in Programming (C++, Delphi, VB/VBS, CMD/batch, etc.)
I would suggest that you look into using WinRAR's @listfiles. You can use standard batch commands to create a listfile for all files below your size threshold and archive and delete them using your command line. Once done you can run a command to archive the files left, those above the size threshold. -
Sorting files in numerical order in Windows 2000
Yzöwl replied to Tommy's topic in Windows 2000/2003/NT4
Name the files properly with a leading zero, (01, 02, 03, ..., 10, ..., 20, ..., 30, ...) -
two forfiles problems
Yzöwl replied to Ponch's topic in Programming (C++, Delphi, VB/VBS, CMD/batch, etc.)
Well other than it wasn't the question, you're correct in that it isn't actually required.mind you I'd have considered 'more normal' as, FOR %%A IN (*.exe) DO ( -
I didn't ask you to remove anything, what I suggested was that in taking donations you should at least have had the courtesy of noting the details of those doing so. The fact that you didn't goes a long way to showing me how little your thanks really means. You will find that your 'beta testers' would be a lot more likely to support you if you spend more time supporting your project here.
-
Excuse me but so far I have failed to see your responses to the multitude of errors which have been reported. When you create a project here I expect you to visibly and actively support it. Your product seems as if you're now not marketing it as a beta product, (version 6), we are not a platform for blatantly advertising your product. Finally I do hope that you are not admitting to taking donations and not keeping a track of who made those donations and of how much, because that would be more unforgivable than creating a poor product with little or no support.
-
two forfiles problems
Yzöwl replied to Ponch's topic in Programming (C++, Delphi, VB/VBS, CMD/batch, etc.)
Try this and tell me what it says: forfiles /P KB /M *.exe /C "cmd /c echo @path" BTW - [Windows 7] Both forward slash and a hyphen work on my system anyhow. forfiles -P KB -M *.exe -C "cmd /c echo @path" If you wish to try it with your non Win7 functioning command try this: forfiles -PKB -M*.exe -C"cmd /c echo @path" In any case it should show the full path including the executable file name and extension. -
two forfiles problems
Yzöwl replied to Ponch's topic in Programming (C++, Delphi, VB/VBS, CMD/batch, etc.)
I take it that when you state 2FILE you mean @file, however because forfiles returns variables in double quotes I'd be inclined to use @path FORFILES /P KB /M *.exe /C "@path /quiet /passive /integrate:C:\temp\ris" There should be a space between the forfiles switch and the data following it. -
I'd suggest you get a copy of a utility/program which will firstly back up your MBR, then fix it. You are being told that the MBR is not that which is normally expected therefore unless you've got some special partitioning system or non Windows OS installed on the hard disk, (doubtful unless you were willing to destroy that earlier with fixmbr anyhow). You can use the Command Line Interface freeware version of MBRWizard to perform this task.
-
renaming files in CMD scripts
Yzöwl replied to DosCode's topic in Programming (C++, Delphi, VB/VBS, CMD/batch, etc.)
It is the script which is extremely poor, not the method you've used. -
renaming files in CMD scripts
Yzöwl replied to DosCode's topic in Programming (C++, Delphi, VB/VBS, CMD/batch, etc.)
Your posts generally appear to have one thing in common, negatvity towards the previous respondees help. PS Will you please stop editing all of your posts after their content has been read in the context of the thread. I should not have to go back to a post I've already read in order to see if it has changed since I last read it. The script you have added which was not there before is as bad as the last one you provided and shows that you have not learned anything from the help you've been given here! -
renaming files in CMD scripts
Yzöwl replied to DosCode's topic in Programming (C++, Delphi, VB/VBS, CMD/batch, etc.)
You have once again failed to admit your failures or credit others efforts, this will not help you in further requests for help here. If you cannot see the correlation between give and take then I'm afraid a Forum is not the best place for you to continue your learning process. You never, I placed it here because you are not getting another Topic out of that question. -
renaming files in CMD scripts
Yzöwl replied to DosCode's topic in Programming (C++, Delphi, VB/VBS, CMD/batch, etc.)
I've written that already, but I will recall it to you. It is not a fault! I decided to rename the files (to remove prefix) before I have decided to write script that renames the files according html description. No, this Forums Members as good as wrote it for you but you don't need it, it serves no purpose. This newer single script negates its use!!! You are the only person running a script to change a file name before running another script to change the same file name, that can only be your fault. Yes I would!, but if you think for one minute that we are going to start anther four page Topic based on this sparse request, then the answer is most certainly No! Please don't think that you will get the last word in this Topic unless it is an apology for your failure to listen, learn, understand or adequately thank those who have endeavoured to help you. -
renaming files in CMD scripts
Yzöwl replied to DosCode's topic in Programming (C++, Delphi, VB/VBS, CMD/batch, etc.)
This script prints REN "gen_0_3.pdf" "GEN 0.3 Record of AIP Supplements.pdf" REN "gen_2_1.pdf" "GEN 2.1 Measuring System, Aircraft Markings, Holidays.pdf" REN "gen_4_1.pdf" "GEN 4.1 Charges for Aerodromes and Heliports.pdf" REN "gen_4_2.pdf" "GEN 4.2 Charges for Air Navigation Services.pdf" Press any key to continue... So pdfs staring by digit are not listed. That's because .pdfs starting with a digit only do so because you've already ran a completely unnecessary script on the files to change their name, that's not my fault, its yours. I provided code in exact response to the question I asked, (and you answered). I will certainly not be producing additional code to cater for your inability to use common sense approach to your work nor for you to bastardise into a script as bad as the one you've just posted. -
renaming files in CMD scripts
Yzöwl replied to DosCode's topic in Programming (C++, Delphi, VB/VBS, CMD/batch, etc.)
Hello! How about thanking me for my effort and providing feedback to the Topic, (instead of acknowledging someone elses solution which you've already stated you are not interested in). -
renaming files in CMD scripts
Yzöwl replied to DosCode's topic in Programming (C++, Delphi, VB/VBS, CMD/batch, etc.)
If that's all you want to do, here's a quick untested script. @ECHO OFF SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION FOR /F "TOKENS=*" %%A IN ( 'DIR/B/A-D^|FINDSTR/BERIC:"GEN[ ][0-9][ ].*[.]HTML"' ) DO ( FOR /F "TOKENS=*" %%B IN ( 'FINDSTR/RIC:"[.]PDF[\"][ ]*CLASS^=\"ULINE\"" "%%A"' ) DO ( SET _L=%%B FOR /F "USEBACKQ TOKENS=2,3 DELIMS==" %%C IN ('%%B') DO ( SET _P=%%C SET _D=%%D FOR /F "USEBACKQ" %%E IN ('!_P:/^=\!') DO ( SET _P=%%~nxE SET _X=%%~xE ) FOR /F "USEBACKQ DELIMS=<" %%E IN ('!_D:*GEN^=!') DO ( SET _D=GEN%%E!_X! ) IF EXIST "!_P!" ECHO=REN "!_P!" "!_D!" ) ) ) PAUSERemove "ECHO=" from the bottom IF EXIST line and the PAUSE line if you're happy with the output. I do not give permission for this script to be posted on another site. -
renaming files in CMD scripts
Yzöwl replied to DosCode's topic in Programming (C++, Delphi, VB/VBS, CMD/batch, etc.)
Is that your answer to my question? Is the following example what you are trying to achieve? Have you not already renamed the downloaded file, "EK_GEN_0_2_en.pdf", to "0_2_en.pdf"? And are you now your wanting to further rename it to "GEN 0.2 Record of AIP Amendments.pdf"Is your goal to rename the downloaded file "EK_GEN_0_2_en.pdf" to "GEN 0.2 Record of AIP Amendments.pdf"? -
renaming files in CMD scripts
Yzöwl replied to DosCode's topic in Programming (C++, Delphi, VB/VBS, CMD/batch, etc.)
Why then did you invite someone who has not only failed to answer your question but also provided non working code to join our Forum and post it in this Topic? Now if I think back to a previous Topic of yours I seem to recall you asking about changing the .pdf file names by removing some characters from the beginning of them, are these in fact the same files that you are once again renaming? e.g. Taking the following line from my previous posts GEN 0 GENERAL.html output: Have you not already renamed the downloaded file, "EK_GEN_0_2_en.pdf", to "0_2_en.pdf"? And are you now your wanting to further rename it to "GEN 0.2 Record of AIP Amendments.pdf"