Search found 590 matches

by Compo
31 Jul 2014 14:56
Forum: DOS Batch Forum
Topic: Space-Time Continuum Problem
Replies: 5
Views: 4366

Re: Space-Time Continuum Problem

Here's a batch file utilising powershell:

Code: Select all

@Echo Off & SetLocal
For /F "Tokens=*" %%A In ('PowerShell -C "&{Get-Date -f "MM-dd-yyyy-HH.mm"}"'
   ) Do Set "d8ime=%%A"
Echo(%d8ime%
>Nul Timeout 5
by Compo
29 Jul 2014 10:49
Forum: DOS Batch Forum
Topic: .BAT copy and paste with time taken
Replies: 6
Views: 5057

Re: .BAT copy and paste with time taken

I think the requirement is to copy a single file, measure the time elapsed, and then delete the copied file - so they can repeat the task later. Your robocopy command seems to copy folders recursively and move the folders. The original question says 1) Copy a folder from ‘My Document’ to another lo...
by Compo
28 Jul 2014 13:00
Forum: DOS Batch Forum
Topic: .BAT copy and paste with time taken
Replies: 6
Views: 5057

Re: .BAT copy and paste with time taken

RoboCopy will do the Copy Delete and Time Taken. @Echo off SetLocal Set Src=C:\Users\UserName\My Documents\ Set Dst=F:\TEST\ Set Dir=My Folder Set OutLog=C:\Logs\CopyOput.txt REM RoboCopy "%Src%%Dir%" "%Dst%%Dir%" /E /MOVE /LOG+:"%OutLog%" /NC /NFL /NDL /NP RoboCopy &qu...
by Compo
25 Jul 2014 22:59
Forum: DOS Batch Forum
Topic: Renaming Files With the Names of Their Parent Directories
Replies: 12
Views: 7313

Re: Renaming Files With the Names of Their Parent Directorie

foxidrive, the opening post stated that there are other files in the directories too, not just a single file with a zip extension so as squashman alluded to you may have needed to add *.zip before closing your first 'for' command.
by Compo
25 Jul 2014 09:37
Forum: DOS Batch Forum
Topic: Renaming Files With the Names of Their Parent Directories
Replies: 12
Views: 7313

Re: Renaming Files With the Names of Their Parent Directorie

Here's something which may help your learning: @Echo Off SetLocal EnableExtensions DisableDelayedExpansion Rem Setting desired extension Set _ext=.zip Rem Ensuring that we are working from the script directory PushD %~dp0 Rem Checking the source location Echo( Searching %~p0 for Directories containi...
by Compo
25 Jul 2014 08:59
Forum: DOS Batch Forum
Topic: Renaming Files With the Names of Their Parent Directories
Replies: 12
Views: 7313

Re: Renaming Files With the Names of Their Parent Directorie

So we've now established that when you stated XXX you meant zip. Okay what about the directory structure, based upon what you've said, I'm assuming all directories are only a single level and not nested several levels within each other. What about the base Operating Systems, Windows 95, 2000?
by Compo
25 Jul 2014 08:52
Forum: DOS Batch Forum
Topic: Renaming Files With the Names of Their Parent Directories
Replies: 12
Views: 7313

Re: Renaming Files With the Names of Their Parent Directorie

Try giving us the specifics now then, (the search will not be affected as it will be based upon that which you've already posted).
by Compo
25 Jul 2014 08:44
Forum: DOS Batch Forum
Topic: Renaming Files With the Names of Their Parent Directories
Replies: 12
Views: 7313

Re: Renaming Files With the Names of Their Parent Directorie

I'm intrigued, are the files embroidery designs, digital CCTV recordings or photo album panoramas?
by Compo
21 Jul 2014 17:39
Forum: DOS Batch Forum
Topic: compare a text file with files...
Replies: 18
Views: 10915

Re: compare a text file with files...

If you wanted something a little more simple to follow which adds a little protection here is an example of your last posting with that: @Echo Off & SetLocal EnableExtensions Rem Setting and Checking Variables Set RomLocn=F:\emulators\mame\roms If Not Exist "%RomLocn%\" (Echo=%RomLocn%...
by Compo
18 Jul 2014 09:13
Forum: DOS Batch Forum
Topic: How to check for admin rights ?
Replies: 14
Views: 14600

Re: How to check for admin rights ?

I know this is now 5 days old but since you are running 8.1, this is what I use to force the end user to right-click when running as a non-admin, if admin it will just continue on. ~DP 8) :: ### AdminCheck reg query "HKU\S-1-5-19" >NUL 2>&1 && ( goto admin ) || ( <SNIP> I reme...
by Compo
16 Jul 2014 15:53
Forum: DOS Batch Forum
Topic: Deleting a folder via Batch file
Replies: 8
Views: 5801

Re: Deleting a folder via Batch file

Code: Select all

@Echo Off & SetLocal
For /F "Tokens=*" %%A In ('Dir/B/AD/OD "H:\Neals Personal\Test*"') Do Set _D="%%~fA"
Echo( RD/S/Q %_D%&Pause
Remove the first six and last six characters on the last line if you are happy with the result in the console window!
by Compo
16 Jul 2014 13:25
Forum: DOS Batch Forum
Topic: Deleting a folder via Batch file
Replies: 8
Views: 5801

Re: Deleting a folder via Batch file

The location of those files are H:\Neals Personal\. So what i was really trying to do was every night i want to delete a backup folder that is a day old. Please be more specific, are you deleting files which begin with Test located at "H:\Neals Personal"? or are you removing a directory b...
by Compo
16 Jul 2014 09:58
Forum: DOS Batch Forum
Topic: Deleting a folder via Batch file
Replies: 8
Views: 5801

Re: Deleting a folder via Batch file

Regardless of the above, there is one thing which appears quite obvious to me...

Do you really want to use a command named FORFILES to work with a DIRECTORY and then use DELETE as opposed to ReMoveDIRectory on it?
by Compo
14 Jul 2014 10:04
Forum: DOS Batch Forum
Topic: edit value in gpedit
Replies: 9
Views: 7170

Re: edit value in gpedit

Thanks Compo i understand i can use this work with change registry value,but i need change (Control) value in gpedit.exe there is no way to control value in gpedit.exe Please try and explain to me the reason why using the registry to toggle a group policy value is not acceptable. Other than that yo...
by Compo
13 Jul 2014 16:25
Forum: DOS Batch Forum
Topic: edit value in gpedit
Replies: 9
Views: 7170

Re: edit value in gpedit

You could use the registry, (Ref: http://technet.microsoft.com/en-us/library/dd939844(v=ws.10).aspx).
Example:

Code: Select all

@Echo Off & SetLocal
(Set _PWU=HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate)
Reg Add %_PWU% /V DisableWindowsUpdateAccess /T REG_DWORD /D 0 /F >Nul