Content Type
Profiles
Forums
Events
Everything posted by Yzöwl
-
Whilst this is a fairly standard company/business request, (with many examples available across the web); there are websites where persons are happy to produce new or bespoke solutions from existing scripts for a little remuneration. I'd suggest on this occasion you use one of them.
-
Batch Sorting files into folders
Yzöwl replied to Pachilles's topic in Programming (C++, Delphi, VB/VBS, CMD/batch, etc.)
Just thought I'd highlight the above again as a reminder that Your solution(s) need to bear the following in mind; to move 'apple.and.orange.comparison.001.doc' into \apple will make in no longer available to place in \orange! You'd problably need to use a copy method marking any successfully copied file for later deletion. -
For loop problem
Yzöwl replied to brian873's topic in Programming (C++, Delphi, VB/VBS, CMD/batch, etc.)
For such a scenario you could try: FOR /F "USEBACKQ TOKENS=2 DELIMS==," %%# IN ("%groupname%Extract.txt") DO ECHO=%%#>>"%groupname%Trim.txt" I would also suggest you use DSQUERY GROUP piping the results through DSGET as suggested above by allen2, it may seem a little OTT for you but it was the first approach I considered when I saw your initial post. -
For loop problem
Yzöwl replied to brian873's topic in Programming (C++, Delphi, VB/VBS, CMD/batch, etc.)
Just to prevent you getting confused with all of the suggestions for changing things, I'd just like to show you the difference betweeen your working and non working scripts. The former is looking at a file whilst the latter is looking at a string. This means that your non working script was parsing the string AccountsExtract.txt not the content of a file named AccountsExtract.txt.The result you should have seen as jaclaz pointed out above should have been ountsExtract.txt and not that which you posted and therefore potentially prevented others from solving your issue. -
For loop problem
Yzöwl replied to brian873's topic in Programming (C++, Delphi, VB/VBS, CMD/batch, etc.)
Before looking at the latter script I'd suggest you start by 'improving' the first one. Get rid of everything below the DSQUERY line and replace it with something like this: FOR /F "TOKENS=2 DELIMS==," %%# IN ( 'FINDSTR/B "CN=" GroupMemberExtract.txt') DO ECHO=%%#>>GroupMemberTrim.txt <EDIT /> You will then see your problem which was caused by the inclusion of double quotes around the file name will have gone. FOR /F "TOKENS=2 DELIMS==," %%# IN ( 'FINDSTR/B "CN=" "GroupMemberExtract.txt"') DO ECHO=%%#>>GroupMemberTrim.txt -
The site information suggests otherwise, did you see the section I quoted? specifically the text in red! I see no reason to refuse you the opportunity to do so. If I find something in your PM which may be of interest to the Forum and it can be made public without causing privacy/security issues I may after review ask you post it here.
-
It's not really a security issue though is it? You are installing updates, you are telling them you are installing updates and you are showing them which updates you are running. The only time the file could be read from the hidden location is during the updating process, whilst it's running, and even then it would only be found by someone specifically knowing what to look for and where to look for it. The file contains nothing which would benefit anyone other than someone wanting to know how to formulate a for loop; what's wrong with them wanting to learn something too? ExeScript
-
winrar sfx comment.txt through batch file
Yzöwl replied to darksimoon's topic in Application Installs
The usual method of escaping percent characters in batch files is by doubling them up! >OUTFILE.EXT ECHO=%%TEMP%% -
But in Windows 7 I get What can I do? That's because, the double percent should not be used from winnt.sif. Example [GuiRunOnce] DetachedProgram = CMD.EXE Arguments = "/Q /C FOR %a IN (C D E F G H I J K L M N O P Q R S T U V W X Y Z) DO IF EXIST %a:\<unique> SET CDROM=%a" The problem however with this approach to the setting of the CDROM variable is that as soon as that command has run, the variable which was local only to that CMD.EXE session only will be removed.
-
You had not checked with myself over PM as quoted above (from rule 8). Reading the description for the Forum you posted in, does your message fall under this category (Code snippets, tutorials, and help on implementing code)? I actually did move your post to a more appropriate area, (this is a Forum and not your Personal Blog), the fact that you cannot see your post should give a clue as to which area was deemed most appropriate.
-
Batch File Date Help
Yzöwl replied to s2nrbald's topic in Programming (C++, Delphi, VB/VBS, CMD/batch, etc.)
Please also bear in mind that in may be prudent to incorporate a check that the 'file' does not already have that date incorporated within its file name. It may then also be necessary to ensure that conflicts of files modified more than once in any day are catered for adequately in your copy procedure. -
Depending upon poison characters, and using a cmd file, simply using a CALL may be all you need.FOR /F "DELIMS=" %%# IN (1.INF) DO CALL :SUB %%# GOTO :EOF :SUB >>TEMP.TXT ECHO=%*
-
Not only does your 'fix' not show that your request of white space from the beginning of lines has been fulfilled you apear to have been a little carried away with a specific character, ^.
-
control cscui.dll,,1
-
What is the smalest Windows 7 Edition ?
Yzöwl replied to ALIENQuake's topic in Unattended Windows 7/Server 2008R2
Windows 7 Starter Edition is the smallest but depending upon your device it may be Windows Embedded Compact 7. Polite Warning Any discussion of pre-made illegal Windows distributions will attract the Ban Hammer -
I know it's not an answer to your question, but why does having those particular drivers matter? After a few weeks they will be out of date and any machine installed using that particular media will be out of date and will need updating anyhow. Surely for the creation of install media you only require working drivers for your particular hardware, the rest is a future preference for the end user!
-
This should suffice as long as you don't already have some of those directories already existing: @ECHO OFF & SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION FOR /L %%# IN (100501,1,101000) DO SET "_=%%#" & MD !_:~1!\Results @net_user I read all the way through your script: …and you made a mistake on the last line!
-
I'm not assuming that you're in Italy, your flag is Italian and IP address is Italian, (telecomitalia.it). Since I was replying directly to you, there was no reason not to structure my response directly to you. The output of WMIC cannot be guaranteed to produce a specific number of lines, therefore the prudent thing to do is to skip all but your intended line, not skip the first line and keep all others. You can output information you don't need in order to have something definite to FIND if you wish, it's your script, but since you know when you formulate your GET's that none of the headers will contain a +, - or numeric value, it would appear a pointless addition.
-
Well you could go for a findstr covering both options: @ECHO OFF & SETLOCAL ENABLEEXTENSIONS DISABLEDELAYEDEXPANSION IF %1' EQU ' GOTO :EOF SET "P_=%~1" & SET "D_=" FOR /F "USEBACKQ" %%# IN (`WMIC DATAFILE WHERE "NAME='%P_:\=\\%'" GET^ CREATIONDATE^|FINDSTR [+-]`) DO SET D_=%%~# ECHO=%D_:~6,2%/%D_:~4,2%/%D_:~,4% %~nx1 PAUSEOr find something unique to the output line only, I'd be inclined to think that a 0 will always be there: @ECHO OFF & SETLOCAL ENABLEEXTENSIONS DISABLEDELAYEDEXPANSION IF %1' EQU ' GOTO :EOF SET "P_=%~1" & SET "D_=" FOR /F "USEBACKQ" %%# IN (`WMIC DATAFILE WHERE "NAME='%P_:\=\\%'" GET^ CREATIONDATE^|FIND "0"`) DO SET D_=%%~# ECHO=%D_:~6,2%/%D_:~4,2%/%D_:~,4% %~nx1 PAUSE