Over 1 million tech questions and answers.

How to create a batch file to read size of file on specific folder path

Q: How to create a batch file to read size of file on specific folder path

Dear All,

I need to create a batch file which can read the size of file(e.g. 1kb, 2kb...etc) from specific folder and detect 0kb file and convert it to text file (showing 0kb file size) with alarm.

I am not really sure how to write command for this batch file. Please help :-(

RELEVANCY SCORE 200
Preferred Solution: How to create a batch file to read size of file on specific folder path

I recommend downloading and running Reimage. It's a computer repair tool that has been proven to identify and fix many Windows problems with a high level of success.

I've used it in the past to identify and fix everything from blue screens (BSOD's), ActiveX errors, corrupt files and processes, dll/exe/sys errors, recover lost memory, Windows update problems, defragging, malware removal etc.

You can download it direct from this link http://downloadreimage.com/download.php. (This link will automatically start a download of Reimage that you can save to your computer.)

A: How to create a batch file to read size of file on specific folder path

Read other 10 answers
RELEVANCY SCORE 113.2

I want a batch to select and open a random link file in a folder i have. All the links are music videos I like to listen to, and I kind of want to just have an option for 'surprise me!'.
I can change the file names if I have to, and I have a basic batch file ability. I know the simple commands, but nothing of the variables, signs-involving commands (&%!?), etc.

Also, I want to learn a whole lot more about programming/java/batch file, so it'd be awesome if any code could be explained. Thank you, in advance

A:I need a batch file to open a random file within a certain folder/path

There's a free Windows scripting language called Autoit3 that would do this task easily using these functons:

Random
_FileListToArray

AutoIt - AutoItScript
It has a Basic like syntax and is easy to learn.

Another popular scripting for Windows is AutoHotkey
AutoHotkey: macro and automation Windows scripting language

The syntax can be confusing but it has object support and is more powerful.

Of course there are tons of others for Windows:
Rexx
Python
Perl
Ruby

Here's a list. The details for each tell which OS are supported:
Free Programming Languages - Freebyte's Guide to

Read other 5 answers
RELEVANCY SCORE 105.6

For Windows 2000/2003

I know that I will eventually figure this out using some spectacular (to me) FOR command but I have a feeling this would be so easy for a seasoned batch file writer to just pound out in a few secs/mins.

Ultimately I would like to have a batch file that searches through a directory and all subdirs to find all files that are 0 (zero) KB in size and then copies the files to a temp location keeping the directory structure intact.
If copying them is not possible while keeping the dir structure intact, a report listing what filenames are in what directory would be okay.

Appreciate any assistance!

Thanks!!!

Angel
 

A:Help creating batch file to search subdirs for files of a specific size

This is actually really ugly to do in pure vanilla command script.

The listing part you can get in 2 seconds anywhere anytime by using:
for /f %i in ('dir * /a-d/b/s') do @if %~zi EQU 0 echo "%i" >> zerofiles.txt
zerofiles.txt will contain full list of zero byte files.

The batch script was harder - only because it's hard to do string replacement without better string manipulation programs like sed etc. Also it requires the delayed variable expansion support to be enabled (start cmd /V:ON) or follow cmd /? for instructions on turning it on permanently.

@echo off
SETLOCAL

if "%~1"=="" echo %~nx0 requires Destination folder as an argument &goto end
set ROOTDEST=%~1
if NOT "%~2"=="" set ROOTSOURCE=%~2
if NOT defined ROOTSOURCE set ROOTSOURCE=%CD%

call :GetSizeRootSource "%ROOTSOURCE%" "%TEMP%\%RANDOM%.junk.txt"

for /f %%i in ('dir * /a-d/b/s') do @if %%~zi EQU 0 call :CopyZero "%ROOTSOURCE%" "%ROOTDEST%" "%%i"
goto end
:GetSizeRootSource
REM *** there's no length command in basic cmd script so we'll use hack
REM *** dump string to text file and get size of file minus two (CR/LF)
echo %~1>%~2
set /A ROOTSOURCELENGTH=%~z2-2
del %~2 > nul
goto :eof
:SkipXXChars
set Skip1Char=%~1
set Count=%~2
for /L %%C in (1,1,%Count%) do call :Skip1Char %Skip1Char%
set SkipXXChars=%Skip1Char%
goto :eof

:Skip1Char
REM *** this function ... Read more

Read other 1 answers
RELEVANCY SCORE 101.2

I'm trying to write a batch file that when run creates a folder named "Backup" followed by the time it was created, and then copies files to that folder.

When I run

md "C:\Users\MasterControlProgram\Documents\MC Server With Backup\Backups\Backup %DATE%\"
xcopy /e /v /y "C:\Users\MasterControlProgram\Documents\MC Server With Backup\Server\world" "C:\Users\MasterControlProgram\Documents\MC Server With Backup\Backups\Backup %DATE%\"
pause

It creates a folder named the date it was created and places the folders in it. How do I make it so the folder is named the time instead of the date?

A:Batch file to create a folder with name of the time.

you could do something like the below.
*disclaimer*: I am a fairly decent UNIX shell script programmer, but I suck at Windows programming. I did NOT test this out, but it should give you the general idea.

set SOURCEFOLDER="C:\Master"
set BACKUPTIME=%TIME%
set BACKUPFOLDER="C:\blah\Backup %BACKUPTIME%"

md "%BACKUPFOLDER%"
xcopy foo "%SOURCEFOLDER%" "%BACKUPFOLDER%"

Read other 2 answers
RELEVANCY SCORE 101.2

The batch file I am creating needs a command to create a temporary folder and then delete it when no longer needed. can this be done? How?
 
Bill

A:How to create a folder in a batch file,( .bat) and delete it

 Just use the mkdir command.  For the syntax just type mkdir /? from the command prompt.
 
Good luck.

Read other 3 answers
RELEVANCY SCORE 101.2

Hello
I have been trying to create a shortcut to launch a batch file one folder up from the shortcut location.
I have been able to do this using and intermediate batch file in the same folder as the shortcut as follows:
Intermediate.bat:
@echo off
FOR %%V IN ("%~dp0..\") DO set curdrv=%%~dpV
start "" %curdrv%Oneup.bat

And the shortcut target is:
%windir%\system32\cmd.exe /c Intermediate.bat

and the 'Start in' is left blank.

This way I can move these folders anywhere on the drive or another drive and the shortcut still works.
However, I would like to leave out the Intermediate.bat file and launch the Oneup.bat directly. I tried:
%windir%\system32\cmd.exe /c FOR %%V IN ("%~dp0..\") DO set curdrv=%%~dpV && start "" %curdrv%Oneup.bat
in the Target of the shortcut, but it doesn't work.
Is there some trick to getting this to work?
Thanks

Read other answers
RELEVANCY SCORE 100.4

Hi

I am using following batch file for cleaning the desktop and also for taking backup of desktop:

@echo off

set curr_date=%DATE:~10,4%-%DATE:~4,2%-%DATE:~7,2%

mkdir "%USERPROFILE%\My Documents\backup\%curr_date%_backup"

xcopy "%USERPROFILE%\Desktop" "%USERPROFILE%\My Documents\backup\%curr_date%_backup" /D/S/H/V/C/F/K/Y

for /d /r "%USERPROFILE%\Desktop" %%x in (*) do rd /s /q "%%x"
for /r "%USERPROFILE%\Desktop" %%x in (*) do del /f "%%x"

copy "%USERPROFILE%\My Documents\backup\%curr_date%_backup\*.lnk" "%USERPROFILE%\Desktop\"

del /q "%USERPROFILE%\My Documents\backup\%curr_date%_backup\*.lnk"

In the first line I am creating a folder with current date, e.g. curr_date_backup. Second, copying the contents of Desktop to the newly created folder. Third, deleting directories from the desktop. Forth, deleting files from the desktop. fifth, Copy back all the shortcuts to the desktop. sixth, deleting all the shortcuts from Current date folder.

This batch file is working perfectly in Windows XP. It works in win 7 also but the problem is that the name of the current date folder created by first command is "Desktop". when I use command prompt to check the name, the name is correct. I checked the properties of the folder the correct is there also. But in windows the name doesn't match with the expected one.

I need help. Kindly tell me what's going on? why window 7... Read more

A:How to create a current date folder using batch file?

Works for me, at least the first two commands work as advertised.

test.bat
set curr_date=%DATE:~10,4%-%DATE:~4,2%-%DATE:~7,2%
echo %curr_date%"

mkdir "%USERPROFILE%\My Documents\backup\%curr_date%_backup"
dir "%USERPROFILE%\My Documents\backup"






Quote:
C:\Users\xxxxxxx>set curr_date=2011-11-21

C:\Users\xxxxxxx>echo 2011-11-21"
2011-11-21"

C:\Users\xxxxxxx>mkdir "C:\Users\xxxxxxx\My Documents\backup\2011-11-21_backup"

C:\Users\xxxxxxx>dir "C:\Users\xxxxxxx\My Documents\backup"
Volume in drive C is D370_C
Volume Serial Number is C89E-70E8

Directory of C:\Users\xxxxxxx\My Documents\backup

11/21/2011 01:30 PM <DIR> .
11/21/2011 01:30 PM <DIR> ..
11/21/2011 01:30 PM <DIR> 2011-11-21_backup
0 File(s) 0 bytes
3 Dir(s) 28,082,577,408 bytes free

Read other 8 answers
RELEVANCY SCORE 99.2

Ok I'm totally at a loss on how to word this so I'm just going to write it out the best that I can...

First I have a batch file that I'm writing that will convert mp4 files to mp3 files (I have a lot) for a buddies band using ffmpeg.

Here's the code that I'm using:

ffmpeg -i folder\video.mp4 -f mp3 -ab 160000 -vn "\different folder\music.mp3"

what I would like to do is add to this so that I don't have to write out this code for every file I have... :/

I have the mp4 files in one folder and than the mp3 files are saving to another folder.

So here's an example of what the code will do if it isn't clear yet.

Folder 1:

video1.mp4
video2.mp4
video3.mp4

what it should do is grab video1.mp4 and convert it.

ffmpeg -i folder\video1.mp4 -f mp3 -ab 160000 -vn "\different folder\music1.mp3"

and than move onto the next one

ffmpeg -i folder\video2.mp4 -f mp3 -ab 160000 -vn "\different folder\music2.mp3"

and than the next one

ffmpeg -i folder\video3.mp4 -f mp3 -ab 160000 -vn "\different folder\music3.mp3"

It's going to have to grab the name from the mp4 file and insert it for the mp3 file.

I can get around pretty good in cmd if it's basic commands but when it comes to something like this I'm a little confused...

Thanks for the help in advance!
I'll see what i can do about searching some more on what I would have to do and if I find the solution I'll post it here if it isn't already answered.

A:Batch File that grabs file names from folder to insert into batch file

A DOS "for /f" loop should do the trick, although changing the filename extension for the output to do everything in one line escapes me at the moment.

Perhaps you could do a dir .\folder\*.mp4/s/b > mp4s.txt, then make a copy of that and edit each line to rename the file to the destination name, and save it as mp3s.txt. Then you just feed both the source (mp4s.txt) and destination (mp3s.txt) filesnames into the for /f loop which handles the ffmpeg conversion.

Quite a crude solution and you'd have to handpatch the destination filenames, but i can't think of how to get a source mp4 filename and then just change the extension.

Read other 3 answers
RELEVANCY SCORE 99.2

hi so work in an recruitment office and im trying to create a batch file that the computers can run on a schedule to create a folder with that days date on it and move all files from the desktop to that folder( also created on the desktop), i want the code to only move files and leave folders and shortcuts unaffected

this is what i've got so far.






Quote:
cd desktop

for /f "tokens=1-3 delims=/" %%a in ("%date%") do md "%%a_%%b_%%c"
mkdir c:\users\training\desktop\%date:/=%

MOVE c:\users\training1\desktop\*.* c:\users\training1\desktop\%date:/=%


right now it is making the folder but not moving anything i know it has something to do with the \%date:/=%

il need this batch file to run from a hidden location so that 1. the students dont mess with it and 2. so the batch doesn't move itself from the desktop. also the computers all have different user names so if i could get something that will make "training1" what ever the current logged in user is so i don't have to rewrite the batch for each of the 60 or so computers we have.

A:batch&task to create new folder and move all desktop file to it

Especially with files and folders I find AHK easier to figure out than batch. You can download the free AutoHotkey scripting language here:
AutoHotkey

Here is a script to get you started. I commented out the actual deletions. You can run it and see the desktop files that would be moved in a msgbox. Each loop it asks if you want to quit to escape the tedium. Once you are sure it will work as expected comment out the lines with msgbox and uncomment the FileMove line

If anything gets moved into the folder that shouldn't be you can just drag it back during testing. The variable A_Desktop is the user's desktop directory so the script should work without editing as far as that goes.

Note: free to use at your own risk.


Code:
FormatTime,FolderName,,yyyy_MM_dd
FolderName := A_Desktop "\" FolderName
FileCreateDir,%FolderName%
Loop %A_Desktop%\*.*
{
If (A_LoopFileName = "desktop.ini")
continue
If (SubStr(A_LoopFileName,-3) = ".lnk")
continue
; FileMove,%A_LoopFileLongPath%,%FolderName%
MsgBox % A_LoopFileName
MsgBox, 4388, Quit Loop, Quit Loop?
IfMsgBox,Yes
ExitApp
}

Read other 5 answers
RELEVANCY SCORE 92.4

How to create a batch file that will move files based on the file type?

My Requirement : I need a batch file to copy all .doc files in all my HardDisk to a removable disk say (Z: drive) . Can anyone make it possible using a batch file?Please...Its urgent...

A:How to create a batch file that will move files based on the file type

Download XXCopy
XXCOPY, A Versatile File Management Utility --- Boldly Extended Xcopy
This is a vastly improved and extended version of DOS XCopy
Sorry, can't remember the syntax, but its quite simple if you read the manuel carefully :-)
Put the command line in a .bat file and it will run

Read other 4 answers
RELEVANCY SCORE 92

I would like to know if there is a way to open a file in a program. Basically I want something like this (this is totally wrong):

open "C:Users\*My name*\My Documents\run.swf" in "C:\Program Files (x86)\Mozilla Firefox\firefox.exe

Thanks
 

A:Create a batch file to open a certain file in a certain file

The more standard way to do that is to use the start cmd. You call the program first and the file name second.

start "" "c:\windows\notepad.exe" "c:\somepath\logfile.txt"
 

Read other 2 answers
RELEVANCY SCORE 91.2

Hi all,
I need help to create windows batch file for following requirements.
1. Remove .txt and .log file format in sub folders.
2. Zip individual file inside any sub folders and give file name through command prompt. 
3. Create sub folder zip file include file zip

Read other answers
RELEVANCY SCORE 90.8

I've been searching the web on how to accomplish this but am coming up empty handed so I am hoping someone here can help...

I want my batch file to read a random line from a text file into an environment variable - can this be done?

I am using Windows 2000.
 

A:Batch File -- Read Random Line from External File into an Environment Variable

Read other 6 answers
RELEVANCY SCORE 90

Hello all , i am new to batch programming.

I wish to have a batch file to read .apk file from folder and then copy it to another folder. Then it should rename the copied apk file to test.apk

eg:
i have a file in folder e:\apps\angrybirds.apk , I want to copy this angrybirds.apk to d:\apps and rename it to test.apk

Here the file names in the e:\apps\ will be changing. So what ever may be the name , it should read the name of the file from e:\apps\ folder , copy it to d:\apps\ and rename it to "test.apk" . Test.apk is a fixed rename
 

A:Solved: Batch file to copy a file from folder and rename it in another folder

Read other 12 answers
RELEVANCY SCORE 89.6

Hi,

Can anyone tell me how to get part of a bacth file to read a line from a text file and then set it to a variable.

For example the file contains computername =computer1

how do i get the batch to read that and set computer1 to a variable that can be used within the batch file.

If possible what i would also like to be able to do is once set that to variable, compare it against the correct computer number and if incorrect go back into the batch file and set the line to the correct computer name

Any help is appreciated.

Thanks
 

A:Batch File Read Line Of Text File

Read other 7 answers
RELEVANCY SCORE 89.6

I have a text file located at \\thedrive\a folder\another folder\log.txt. This file contains several lines of this kind of data "jdoe upgraded 09-20-2011 13:42:49.62".
I have a batch file located "d:\folderName" that needs to read the "log.txt" file and obtain the local computer user username if it is in the file. If it is not in the file then a file is to be copied to the d drive from \\thedrive\a folder\another folder\ to "d:\folderName" and then run the file. This is what I currently have
@Echo Off
SetLocal EnableDelayedExpansion
::This line is just in case n has been defined before the batch file is run
Set n=
Set _InputFile="\\thedrive\a folder\another folder\log.txt"
For /F "tokens=*" %%I IN (%_InputFile%) DO (
Set /a n+=1
Set _var!n!=%%I
)
but the log file is not read. If I move the "log.txt" off the network it works just fine. I cannot move the "log.txt" file as other processes use it nor can I copy it.
 

A:Batch file to read from a network text file

Because you have Quotes around your file name you need to use the USEBACKQ option.

Please use CODE tags when posting code.

Code:
@Echo Off
SetLocal EnableDelayedExpansion
::This line is just in case n has been defined before the batch file is run
Set n=
Set _InputFile="\\thedrive\a folder\another folder\log.txt"
For /F "usebackq tokens=*" %%I IN (%_InputFile%) DO (
Set /a n+=1
Set _var!n!=%%I
)

 

Read other 1 answers
RELEVANCY SCORE 89.6

Okay, so basically, I have a whole list of links in a plain text Notepad file, each link on a seperate line. All I am wanting to do is to add a bit of text before each link, specifically: 127.0.0.1 and a couple of spaces.

So this...
Code:

[SIZE=3]somelink.com[/SIZE]
becomes this...
Code:

[SIZE=3]127.0.0.1 somelink.com[/SIZE]
By now you've probably already guessed what I'm trying to do here and what it's for.

So I am wanting some batch file code, executable in a .bat file, which basically reads a Notepad text file, and then add "127.0.0.1 " at the beginning of each line with text on it. I am guessing this is probably a very simple piece of code for someone with some knowledge of MS DOS and batch file code, but that most certainly isn't me, and the only batch files I have ever written have been with help like now.

Thanks for any and all help in advance with this, much appreciated.
 

A:Batch File To Read And Modify Text File

Read other 9 answers
RELEVANCY SCORE 88

I am trying to write a batch program the list the current directory files that end in *.dwg
into a file on my C drive.
I have used the following code:
dir *.dwg /b >C:FileListing.txt
start notepad C:FileListing.txt

This code only gives file names in the current directory.
I need to have a list of path and file names in the file FileListing.txt
Is there a way to do that without including subdirectories??

Thank you,
 

A:Solved: Batch file to list file names in current Folder.

Read other 9 answers
RELEVANCY SCORE 88

I'm trying to write a batch file to run a command line on all of the files in a directory structure and copy the resulting outputs to the same structure but at an alternate root

ie
batch file located at c:\one\two
file to process located at c:\one\two\three\four\five.extension
I want to move the output file five.extension2 now located at c:\one\two\three\four
to new location %NEW_PATH%\three\four

~dp0 will give me the batch path (c:\one\two)
~f will give me the full file path for five.extension (c:\one\two\three\four\five.extension)
~n gives the file name I care about (five)
but I can't seem to find a way to parse out the "\three\four" for the move command (%NEW_PATH%\three\four)

any help would be appreciated

A:Relative file path in Batch

Originally Posted by mosleyrs


I'm trying to write a batch file to run a command line on all of the files in a directory structure and copy the resulting outputs to the same structure but at an alternate root

ie
batch file located at c:\one\two
file to process located at c:\one\two\three\four\five.extension
I want to move the output file five.extension2 now located at c:\one\two\three\four
to new location %NEW_PATH%\three\four

~dp0 will give me the batch path (c:\one\two)
~f will give me the full file path for five.extension (c:\one\two\three\four\five.extension)
~n gives the file name I care about (five)
but I can't seem to find a way to parse out the "\three\four" for the move command (%NEW_PATH%\three\four)

any help would be appreciated



I know this sounds rather dumb of me, maybe I'm just misinterpreting the question, but can't you just copy and paste the created batch file to the new location, sounds like a long way to go to move a file from one place to another, again correct me if you think I've misinterpreted the question

MrNeeds

Read other 4 answers
RELEVANCY SCORE 87.6

Hi

Ive been searching the net for help with this and i just cant find what im looking for.

Im still new at excel macro's so still learning everyday.

I need help to wright a macro that will search in a folder for a file with a specific keyword that can be in the file name.

example: lets say i want to open a file that is in a folder that has "leadership" in the files name.
Because i send the file to people called "leadership.xls" and i recieve files back called "copyofleadership.xls" and different other names but there will always be leadership in the file name.

Can anyone please help me with this.

Thanks
bill6432
 

A:Excel macro to open a file in a folder with a specific keyword in the file names

Read other 6 answers
RELEVANCY SCORE 87.6

I have a computer that is a drone specifically for an outside LED sign. This computer is designed to never shut off and doesn't have any other program on it besides Operating System and the sign software. I need to create a batch file that I can place in the "start-up" folder that will open the program (LEDStudio10) and open the file that I want to play. I have already tried multiple attempts and I was hoping someone out there in sevenforums world would be able to point me in the right direction.

A:batch file open file for program in the startup folder

Task Scheduler. Create a new/basic task. You can invoke your batch script there. This can occur after boot completes, after user logon, etc. You can set it to run daily weekly hourly, etc. You can even have it delay X (preseleted time amounts) minutes/hours after boot/logon if you want.

Task Scheduler - Create New Task

Read other 1 answers
RELEVANCY SCORE 87.6

In Need of proper path for calling specific window help pages.

Example would be: Call "setting up password in the window screen saver" help page.

Is there a way to call any/all specific window help files from within a script?

All advise welcomed! and thank you.
 

A:Call path for specific win help file?

Read other 16 answers
RELEVANCY SCORE 85.6

When trying to open up ANY folder in windows explorer or when trying to access Control Panel, I get the error message: Windows cannot access the specific device, path, or file. You may not have the appropriate permissions to access them.

Many solutions to this involve Control Panel, which I can't access...a catch-22.

I cannot do a System Restore, the error: System Restore does not appear to be functioning correctly on this system (though I have done several successful system restores in the past on this computer)

SFC/scannow error: Windows resource protection could not start the repair service.

Virus Scan, Avira, picks up nothing.

TDSSKiller picks up nothing.

SysInfo.exe reveals nothing about my system...see below
Tech Support Guy System Info Utility version 1.0.0.2
OS Version:
Processor:
Processor Count:
RAM:
Graphics Card:
Hard Drives:
Motherboard:
Antivirus: None

I'm using Windows 7, 64 bit
 

A:Windows cannot access the specific device, path, or file.

Read other 6 answers
RELEVANCY SCORE 85.6

Hey all!
 
So for the last year or so there's been a virus on my PC, but as I don't use my PC as much as my laptop I didn't notice it, until my brother complained about it...
 
So here's the problem... 
 

Whenever I open a file such as Computer, or Control Panel it comes up with this error: windows cannot access the specific device, path  or file. you may not have the appropriate permissions to access the item
 
I believe .exe opens because my younger brothers can manage to open up Minecraft and other games they have... I usually access the main files by opening notepad and clicking load and looking through files I may need... So if you need any other info I'll be checking this thread every 10-5 minutes or so.
 
 
I rally need help ASAP as I need my computer in a bout a week so any help will be appreciated... I know my way around a computer and have tried a load of stuff with no success... using Malwarebytes Anti-Malware.

Please Help!!!

A:windows cannot access the specific device, path or file. you may not have the..

Please download MiniToolBox  , save it to your desktop and run it.
 
Checkmark the following checkboxes:
  List last 10 Event Viewer log
  List Installed Programs
  List Users, Partitions and Memory size.
 
Click Go and paste the content into your next post.
 
Also...please Publish a Snapshot using Speccy - http://www.bleepingcomputer.com/forums/topic323892.html/page__p__1797792#entry1797792 , taking care to post the link.
 
Louis

Read other 17 answers
RELEVANCY SCORE 85.2

Hi friends,

Please guide me how to create a batch file to fit this scenario,

"I have a Folder Named Addons which has 110 Folders which themselves has many sub folders and files of differnet extentions for eg(C:\Program Files\OpenERP\Addons). In this I have to leave around 15 decided Folders and their contents in Addons. I have delete the remaining Folder and its contents. The Number of folders and Their Names may vary every time depending on the Computer.

I have to use batch file both in Windows XP and Windows 7.

I am new one to create batch files. Please guide me.

A:Batch File To delete Specific Folders

Let's say of the 110 folders in the AddOns directory and 10 are dedicated (not to be deleted).

Are those dedicated folder names constant? (they are never changed?)

Read other 3 answers
RELEVANCY SCORE 85.2

hi, I am working on a batch file, such as

[If Service A starts during 10pm-11pm, then stop Service A.]
If this is not possible, then just simply,
[If Service A starts, then stop Service A.]

Thanks!

A:Help with Batch file, if statement in a specific time.

Need a bit more information.

How is Service A being started?
Will the batch file be run manually or from a scheduled entry?

The simplest way to do this is to simply assume it's running and try to stop it.

net stop "Service A"

and not care if it gets an error or not. As I said, more info please.

Read other 6 answers
RELEVANCY SCORE 85.2

Basically the title. Almost every single time i move ANY file or delete any file, the window im in freezes and the progress bar freezes. Now when i create a new folder the window im in freezes also, but i'd say its only 50% of the time. The temporary solution i found was to go to the task bar, end explorer, and restart it using run. Now when i check back on that folder, whatever action I did (ie delete file) does do what i wanted, its just the freezing. I'm looking for a permanent solution to this and any insight would be greatly appreciated.

A:Create New folder, move file, delete file. Explorer Freeze

Hi erod49, try looking in your error logs. You have given a good discription of the problem. Tel us your system specs as well.

To get into your error logs,

Left Click on Start Menu.
Right click on Computer and choose manage.
Click on the event viewer.
You now have loads of options to try and pin down what is happening.
Expand the error tab.
Look for things in the last 24 hours.

Other things to look for are updates, has an update caused this. Has your computer autoupdated any of the motherboard drivers.
Have you tried to restore the computer before the error started or has it always been like that.

Read other 10 answers
RELEVANCY SCORE 84.8

Hello all!
 
So I work tech support at my company and recently had one of our secretaries run into a virus. It was an email containing a fake resume in .doc format that once opened, attempted to direct the computer to download a trojan. AVG detected it right off the bat and quarantined it. I then ran a full system scan with AVG, Malwarebytes, and Spybot and everything came back clean.  I had assumed AVG along with Word being macro-disabled by default kept anything from actually happening.
 
However, at the time of the download she was running our company bookkeeping software (eClub for those interested) and it crashed once she tried to use it again. I check it out and see that the .exe to run eClub had been removed from the eClub folder (let's call it eclub.exe). Weird! So I go ahead and completely uninstall the program and reinstall, only to find eclub.exe was not reinstalled with it. I copy eclub.exe from another computer and try to paste it into the folder, and I'm told I don't have permission to do so. Then things get weird:
 
1. I uninstalled eClub completely again, removed the eClub folder and every possible saved setting for it.
2. I created a blank eClub folder (ex. C:\Program Files\eClub)
3. I can put anything I want into this folder, including .exes, EXCEPT for eclub.exe, getting the insufficient permission error.
4. I can put eclub.exe in subfolders of C:\Program Files\eClub without a problem
 
I checked all my permission levels and have fu... Read more

A:Virus Preventing Specific File from Being Created in Specific Folder

Please post the Malwarebytes Antimalware log in your topic.
 
To find your Malwarebytes log,download mbam-check.exe from here and save it to your desktop.
 
To open the log double click on mbam-check.exe on your desktop.  Copy and paste the log in your topic.
 
================
 Please run TDSSKiller.
 
Please download TDSSKiller from here and save it to your Desktop.
 
The log for the TDSSKiller can be very long.  If you go to the bottom of the log to where you find Scan finished you will see the results of the scan.  If it shows Detected object count: 0 and Actual detected object count: 0, this means that nothing malicious was found and you will not need to post the log.
 
1.  Doubleclick on TDSSKiller.exe to run the application, then click on Change parameters.
 
 
2.  Check Loaded Modules, Verify Driver Digital Signature, and Detect TDLFS file system.
 
If you are asked to reboot because an "Extended Monitoring Driver is required" please click Reboot now.
 
 
3.  Click Start Scan and allow the scan process to run.
 
 
4.  If threats are detected select Cure (if available) for all of them unless otherwise instructed.
 ***Do NOT select Delete!
 
Click on Continue.
 
================
 Emsisoft Emergency Kit
 
Please download Emsisoft Emergency Kit and save it to your desktop. Double click on the EmsisoftEmergencyKit file you downloaded to extract ... Read more

Read other 1 answers
RELEVANCY SCORE 84.8

Windows 2000 on 2 year old E Machine. Problem just started, yesterday. Whenever I click on some , but not all, of my shortcuts on desktop,, I will get a pop-up window that says, " Windows cannot access the specific device, path, or file. You may not have the appropriate permission to acceess this item ." A couple of shortcuts I can open & they work fine. My e mail program, Outlook Express, & Mailwasher, will not work at all. I, also, just noticed that I get the same message window, whenever I try to open some functuions of my computer, such as uninstall programs,,, system restore, & MANY others. I have checked & downloaded all updates, scanned & scanned for viruses, etc., but don't see anything. It will not allow me to even open up the " Hijack this" results , I just downloaded. Any help would be great appreciated. I am not a computer expert.
Thank you !
 

A:" Windows cannot access the specific device, path, or file, et al

Read other 11 answers
RELEVANCY SCORE 84

Hey all. I've reviewed several different examples of how forfiles works. To set the stage, I need to automatically remove files with a file extension of .0 followed by numbers that increment and these files would be 7 days or older. Unfortunately, none of the examples or forfiles /? usage explains how to specify what I need done to file extensions that end with .0xxxxx

Here is what I have so far:


Code:
echo on
rem Remove stats-bin.0* files older than 7 days
forfiles /p "c:\Program Files\MySQL\MySQL Server 4.1\data" /m stats-bin.0* /c "cmd /c del /Q @file /d -7
rem pause
Within the data directory, there are stats-bin.index files, stats.0XXXXX files and others. The goal here is to only remove those files that begin with stats-bin.<numbers>

Currently, this script isn't doing anything. Trying to troubleshoot what I'm doing wrong here. If anyone has another forum they frequent for Windows script-specific help, I'd appreciate it (if this isn't the preferred place to post such a thing).

A:DOS Batch - Forfiles - deleting specific file extensions

You forgot closing quotes for cmd part.

Code:
forfiles /p "c:\Program Files\MySQL\MySQL Server 4.1\data" /m stats-bin.0* /c "cmd /c del /Q @file" /d -7
pause
Have just tested that. Works like a charm!

Read other 1 answers
RELEVANCY SCORE 84

Hi Windows Expert,

May i know how to write a batch file that will copy a folder from local computer to a network shared folder and it will overwrite the existing folder in the network shared folder everyday?

Thanks.

Regards,

Read other answers
RELEVANCY SCORE 84

Hi, i have a desktop computer and a laptop, my computer is on domain and laptop is not on domain,
now i need to access a folder on my desktop computer from my laptop , so if anyone would like to work in that folder they can click and open only that folder, for that i would like to create a batch file and i never did it, so please help me to create one, i will really appreciate it.
 

Read other answers
RELEVANCY SCORE 84

I want to know more about creating a batch file. From which websites i can read about the batch file creating.

if possible give me a link.
 

A:how to create a batch file

Rob's Website is one of my favorites for reference.
http://www.robvanderwoude.com/
 

Read other 1 answers
RELEVANCY SCORE 83.6

This problem just presented it's self, I had been using IE7 for 2 months before showing up. I have tried everything aside from re-installing IE7 to get ride of it. Hopefully somone here can help me?

I am running Windows XP Media edition on a Dell XP laptop wtih IE7. This is my problem.



Everytime I try and open a document online I receive this error message. It dosen't matter what type of file extention it is, it will tell me I don't have access or permissions to my internet temp location.

Logged in as Administrator I have tried:

* Moving my temporary internet file dirrectory to the c:\
* Cleared my bowser histroy, cash, temp files
* setting IE7 settings back to default.

I'd love to use my laptop to view DSMlink .dat logs. Does anyone have some advice for me??

Thank-you
Scott

A:IE7 Cach dirrectory: Windows cannot access the specific device, path or file...

I know this is a tough one, but come on fella's

Read other 5 answers
RELEVANCY SCORE 83.2

Hi,
I need to delete on regular basis some subdirectories of a main directory which have some common strings inside (let's say 123*ABC*) and the problem is that they can be differently nested inside the main directory itself (e.g. Main\sub1\123XX*ABC* and Main\sub1\sub2\123yy*ABC*
and so on). From my knowledge, I was just able to have a batch file which points to a specific subdirectory and deletes any desired 123*ABC* subdirecory just inside itself, but since the locations are so many and changing from time to time, I can't get the
desired result.
Can Anyone please help or give some good advice? Thanks in advance!

Read other answers
RELEVANCY SCORE 83.2

Ok folks--here's the deal. We have a client list (not set up by me) that has the client numbers listed as the first part of the folder name. So for example, the folder names look like this:

999 (Smith)
1002 (Jones)
1003 (Johnson)

etc. There's a couple thousand. So I am thinking some sort of DOS batch routine to rename all the folders in the directory. Essentially, remove the numbers and put them at the end of the folder name so it looks like this:

(Smith) 999
(Jones) 1002
(Johnson) 1003

Ideally, I would also like to strip the () and add a "-" so:

Smith-999
Jones-1002
Johnson-1003

But obviously that's not as important because the'll still be in alphabetical order even with the ().
 

A:DOS batch file to globally change filenames in a specific directory?

Read other 10 answers
RELEVANCY SCORE 83.2

In a batch file or vbs (doesn't matter which and I've tried both) I can't seem to get a window open with size properties, as in width and height in pixels. Also, I need it to not be re-sizable.
All help is appreciated.
Please and thanks!
 

A:Solved: VBS/Batch file help - set size?

You could do it with an AutoHotkey script.

You could use a WinMove command to set the position, width and height of the window. Then use a WinGetPos command in a loop to see if size of the window has changed and if it has put it back to the original size.

You could also check to see if they minimize the window and restore it or make it always on top.
 

Read other 2 answers
RELEVANCY SCORE 83.2

I want to copy files from a folder to another folder named with system date. Actually, I want to such a batch file which gets executed when I click a button on desktop and complete the above task. Also, once created can I edit it, because opening .bat file tells that it is not a valid win32 file.

Read other answers
RELEVANCY SCORE 83.2

Hi, I need to create a batch file or even VB script that will put ~15 text files into separate strings (each text file contains 1 line of text) and then will compare these 15 strings and group them on based on identical strings. Is there any way this is possible? This is what I have got so far...I'm not sure if I am on the right track.
Code:
@Echo Off
SetLocal EnableDelayedExpansion
Set n=
Set InputFile=File1.txt
For /F "tokens=*" %%I IN (%InputFile%) DO (
Set /a n+=1
Set v!n!=%%I
)
EndLocal

 

A:Create Batch For File Comparison

Read other 6 answers
RELEVANCY SCORE 83.2

I want to make a batch file to run sfc /scannow & then restart the computer.
I use XP Home SP2.

I made one with sfc /scannow & shutdown -r but it restarts after sfc /scannow is just starting to run.

I need sfc /scannow to finish & then for the restart command to kick in.
The purpose is to let sfc /scannow to run & the computer to restart & run Error Checking & a boot time Avast scan.

I can set up the Avast & Error checking seperate from the .bat file.
They will run when the computer restarts.
Any help will be appreciated.
Thank you.

A:How To Create A Batch File With 2 Commands

Here is a web site - Making Batch Fileshttp://www.tnd.com/camosun/elex130/dosbatchtutor1.htmlHSould help with your problem.cya l8rThorXP

Read other 10 answers
RELEVANCY SCORE 83.2

I generally run windows aero theme across all four monitors which i am happy with. However when i run a music app called cubase 5, i hear all sorts of squeaks and glitches when i simply move my cursor around the screen. The problem resolves itself when i switch to the standard windows classic theme.


My question is:

How do i write a simple windows batch file that when run by doubleclicking an icon will:

1) switch the theme to windows classic
2) run cubase.exe
3) switch back to windows aero theme when i exit cubase.


I appreciate you considering my query.

All the best.

Andy

A:Is it possible to create a windows batch file to do this?

Something like this should do
Code:
"%windir%\Resources\Ease of Access Themes\classic.theme"
"C:\location\cubase.exe"
tasklist | find "cubase.exe"
if errorlevel 1 "%windir%\Resources\Themes\aero.theme"
pause
Please change cubase filename and location for appropriate ones - I do not have that program.
Delete "pause" if you want cmd window to close upon completion too.

Personalization window will pop up, but that is a regular thing: it always pops up if you start theme file in any way.

Read other 4 answers
RELEVANCY SCORE 83.2
RELEVANCY SCORE 83.2

Hope this is the correct sub forum for this..

Often use a variety of command line functions e.g. winver / netplwiz etc etc

Is there a way of creating a batchfile to include multiple commands with a number option to select...would be so handy

i.e. 1 Netplwiz
2 Winver
3 ???
Thanks

Read other answers
RELEVANCY SCORE 83.2

Just wondering if anyone could help me create this batch file. Have been trying for a while and is starting to really frustrate me. Any help would be greatly appreciated! Thanks.

? Create a batch file called myBackup.bat.
? It will backup all contents of a folder called 'files' to a folder called 'filesBackup'.
? If 'filesBackup' doesn't exist, it should create it.
? If 'filesBackup' is empty it should copy all files including subdirectories.
? If 'filesBackup' is not empty it should copy only newer files, without prompting.
? Don't use absolute paths, only relative folder names.
? You will need to use command line help to find the best command to use and what parameters to use. Copy command won't work, you will need a command that does eXtra.
? Paste the text of the batch file as well as a screen shot into your document.

A:Create Backup batch file, please help!!

Is this for a school assignment?

Why do you want to use relative directory? Why not use env variables?

Read other 2 answers
RELEVANCY SCORE 82.4

Hi Guys ,
I want to copy some files to a specific user profile for many PCs via batch file . For example ,  User name is AAA . I need to copy files to "C:\Users\AAA\Appdata" .  
As sometimes the user profile of AAA located in "C:\Users\AAA" or "C:\Users\AAA.Domainname". So currently I copy the bat file in the startup folder of AAA . The content of bat file is as below . 
xcopy files "%userprofile%\AppData /S /Y

But the shortage is that it will start to run bat and copy file when AAA login every time . So I want to improve the deployment .
So Does any guys know how to assign special user account (AAA) to %userprofile% variable ? So I can run bat file only once via SCCM deployment and no need to add it into startup folder run again and again .
Thanks.

Read other answers
RELEVANCY SCORE 82

What I want to do is a batch file or program so that when you open it, it mimics key presses Alt+Tab. Or at least tell me where's the Flip2D program location

I need it because I want my Synaptics touchpad to open it (this program) when a I press the upper left corner.

Thanks!

A:Create a batch file that mimics Alt+Tab key presses

Hello Mathius,

Here's an exe file I whipped up that acts a Flip2D shortcut that may work for you for this.

Flip 2D Shortcut Program

Hope this helps,
Shawn

Read other 1 answers