I am working on a problem where I need to play an MP3 file twice a day, and then iterate to another file an so on for a 96 day cycle. The day 1 file will play at 6 am and then again at 6 pm. The following day the day 2 file will play at the same times. The cycle will continue until day 96 when the process will start back at day 1.
I would like the script to read the day value from a separate text file and then start the process from there. The text file would just contain the starting number, then would be updated on each iteration.
I will be using Windows task manager to schedule the bat file execution times.
Any help is appreciated, let me know if you need more specifics or context.
Related
In my office they every day double click on the program vsubst to assign a partition of the space on the computer as a drive. I want to make a batch file out of it so they do not have to do this every day. It takes 5 seconds, but 5 people times 5 seconds times 250 working days is 6250 seconds a year!
Can anyone help me out here? This shouldnt be to difficult. I run a windows machine and could put it in the windows task manager.
I guess its something like: Start ....vsubst.exe param param1
Ok. Trial and error got me there. Fill the following line in and place the batch file in your startup programs and you're done :D
start path\VSubst.exe NEWDRIVE FOLDERPATH
exit
I have a program in Linux to write log into files on a regular interval (for
example: 10 minutes every file), so I have a directory hierachy like this:
In which, 20151001 stands for the log dir for the day
2015(year)/10(month)/01(day), and 00 stands for the first hour in the day,
and 00.00 stands for the log file for the first 10 minutes in the first hour
of the day.
In my shell script I need to detect if there is any previous log file is empty,
for example if now the time is 2015/10/09 09:32, the newest log file should be
20151009/09/09.03, the file 09.03 could be an empty file, but the other
older files should not be empty. In order to simplify the problem, I just detect
if the previous file is empty, so I just detect if the file 20151009/09/09.02
is empty. However I have to handle some edge cases, like:
If now the time is:
2015/10/09 09:01
the previous file is in another directory, it’s:
20151009/08/08.05
If now the time is:
2015/10/09 00:01
the previous file is:
20151008/23/23.05
Is there any powerful algorithm or tools to handle my problem, especially the
edge cases?
I need to run similiar multiple mp3 converting processes at the same time with windows command prompt.
As far as I know, if I start one converting process using batch file, only 1 console window apears and only one process starts. After this process is finished (and if there is a command line for it) starts another process and so on.
As I just tested, if I start multiple batch files at the same time, I have more then 75% time economy!!!!! It's very important form me, because overall time processing counts in months (in my case)!
So, my problem is - how to force start all other multiple batch files at the same time and make the main batch file wait for finished executing all others batches. And only then continiue actions in main batch file.
THANK YOU!
i want to make a Visual basic script console app that prints edited if a file has been modified. for example if i have a text file with some notes in and i add it to a folder when its edited the program checks the folder its in and the files then prints the name of the file and modified or not modified
how would i go about doing this i am relatively new to Visual basic script i probably have 4 months basic experience.
console.writeline("what do i do?")
console.writeline("and how do i do it")
and I'm trying to do it as a console app so the preferred outcome i would like to see would be
File Checker
test.txt - Edited
test2.pptx - Un-edited
etc etc etc
If you need an immediate notification, WMI is probably the best route. But WMI will also require your process to be running (in a blocked state) all of the time. Alternatively, you could schedule a VBScript to be launched at some interval and it could check each file's last-modified date against a text file or database that you use to store the modification date the last time the script was run.
An even easier solution would be to just check if the modification time changed since the last run. For example, if your script runs every 10 minutes and you discover a file that was changed within the last 10 minutes, report it.
With CreateObject("Scripting.FileSystemObject")
For Each File In .GetFolder("c:\folder").Files
If DateDiff("n", File.DateLastModified, Now) < 10 Then
' File has been modified in past 10 minutes.
End If
Next
End With
I am very new to Dos Script, however I have a task on hand which I believe will be most efficient to execute in Dos Scipt(.BAT).
I will run this BAT file in Window XP Professional
Currently I have a Drive let's say B: Drive which consists of 30 folders and 100,000+ sub folders(not files)
Within the drive there are more than ten thousand job folder and each with a job number
I need to print out a list of all folders that consist of a job number
The job number pattern
(imagine the job number is A1234567 with the first char always an alphabet and the follow by 6 - 7 numeric character then a space and the job name
e.g B:/Lv1/Lv2/A1234567 xxxxx/Lv4/Lv5/xxx.xls
Unfortunately this job number maybe in different level
e.g B:/Lv1/Lv2/A1234567 xxxxx/Lv4/Lv5/xxx.xls
e.g B:/Lv1/B5678214 xxxxx/Lv3/Lv4/xxx.xls
e.g B:/Lv1/Lv2/Lv3/Lv4/Z0425673 xxxxx/Lv5/Lv6/xxx.doc
Lets say if we start from the top and once the sciprt find the job number, it wont continue to drill down to another level from that folder.
So the outcome will be like this
e.g B:/Lv1/Lv2/A1234567 xxxxx
e.g B:/Lv1/B5678214 xxxxx
e.g B:/Lv1/Lv2/Lv3/Lv4/Z0425673 xxxxx
Do you mean:
e.g B:\Lv1\Lv2\A1234567 xxxxx\Lv4\Lv5\xxx.xls
instead of:
e.g B:/Lv1/Lv2/A1234567 xxxxx/Lv4/Lv5/xxx.xls