vsubst in batch file - windows

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

Related

Cmd batch: Run an exe but kill if after a period of time, if doesn't resolve

I used google but it seems it didin't returned me any relevant links.
Same goes for the reommendations here, so I think I have to ask this as a new question.
Can I run an exe command, but with a timeout included?
Example:
Run the exe, if it does not end alone within 5 minutes, kill it.
The 5 minutes limit is an example, I might want to set it up to 48 hours or something.
Is there a way to do it?

Use a time command in a batch file

In my job there is a time problemes in all the computers.
There is 17 minutes less than "normal time" but i can't fix it by graphic interface so i do cmd : time
But it done it 10-11 times in the day, it's a little bit boring.
Does it exist a batch command to add 17 minutes at each click on the batch.exe ?
I suggest you to auto sync to a time server.

Windows batch script play MP3 files daily

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.

how to detect file change VBS

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

Vb.exe performance time

I am running a vb.exe through automation. In exe I have return a code which takes a data from database and saves that data into file. I ran that .exe for the first time. It took 1 mins. For testing baseline I called same .exe 5 times one after the other. But it took nearly 10 mins to generate.
My question is if it takes 1 min for 1 report to generate then it should take 5 mins to generate 5 report but why it is taking 10 mins (more than the double). Is there any problem while calling a exe one after the other?
No, there isn't a problem with calling an exe multiple times. However, there might be a problem with the data that you're fetching or writing. Maybe you didn't close the database connection correctly upon exiting the program and this causes a delay when you try to read from the database the second time.
But then again... without a more accurate description of what your program exactly does and the relevant pieces of source code, it's very hard to be more specific...

Resources