Explore topic-wise InterviewSolutions in .

This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.

5601.

Solve : how to list all folders in sub-directories?

Answer»

Hello hoping someone can help me with what I should think is a simple batch script I'm trying to create.
What I'm wanting to do is to run said script for it to scan through all sub-folders in the directory run from and create a .txt file listing all sub-folders but not including the current directory or the sub-folders child folders so folder structure could be as follows

>a (from where the script will be run)

>>1
>>>2
>>>3
>>>>4

>>5
>>>6
>>>7
>>>>8

and I want the result to be
2
3
6
7

I've tried
dir /a:d /b /s >".\list.txt"
but this gives me
a/1
a/1/2
a/1/3
a/1/3/4
a/5
a/5/6
a/5/7
a/5/7/8
so is giving me a list but all levels of folders and is creating the FULL path name.

I don't think I'm explaining what I want very clearly but to reiterate I want a list of subfolders but to not include the first level folders or the 3rd level folders and I don't want the full path only the 2nd level folders names.

Thanks, James.Quote

I don't think I'm explaining what I want very clearly
Yes.
Try this.
Some us a lists of folders and files as input.
Some a new list of items you want as output.
Ans wait. The best experts are busy doing other stuff.

batch

Run in top folder (called a in this example)

Code: [Select]@echo off
if exist list.txt DEL list.txt
for /f "delims=" %%A in ('dir /b /ad') do dir /b /ad %%A >> list.txt
list.txt

Code: [Select]2
3
6
7


Geek, he or she explained just fine. Use quote marks like this if the folder names might have spaces

@echo off
if exist list.txt del list.txt
for /f "delims=" %%A in ('dir /b /ad') do dir /b /ad "%%A" >> list.txt
Quote from: Salmon Trout on December 07, 2018, 12:35:47 PM
Geek, he or she explained just fine.
I'm sorry . You are forgiven It looked a bit strange at first look, but you can puzzle it out. What you gave was good advice. Sorry for being snippy.Thank you so much for all the replies and help I’ve been out all day and late now so will try your suggestions in the morning 👍Hi, tried the suggestion and works exactly as hoped you guys are great, I'd be interested in a little explanation on what parts of the code do what as to hopefully get a better understanding so can try and work other coding out myself rather than have to ask for help. Quote from: mrwonker on December 08, 2018, 05:04:51 AM
Hi, tried the suggestion and works exactly as hoped you guys are great, I'd be interested in a little explanation on what parts of the code do what as to hopefully get a better understanding so can try and work other coding out myself rather than have to ask for help.

@echo off
Turn off automatic echoing of each command LINE to the console.

if exist list.txt del list.txt
If list.txt exists, delete it. By implication, if it does not exist, do nothing.

for /f "delims=" %%A in ('dir /b /ad') do dir /b /ad "%%A" >> list.txt
The FOR /F command processes each line of e.g. a command output or text file, in this case the output of dir /b /ad (executed in the same folder that the batch is in) and puts each line, one, by one, into the FOR "metavariable" %%A. Each line is the name of a folder under the folder a. So each time around the LOOP, the metavariable %%A expands to the name of a folder. We do a dir /b /ad on each of these folders, which gives the names of the sub folders CONTAINED within one level below. We echo that output to list.txt, using the >> (append) operator.

You can find full explanations of batch commands on many websites, one of the best is SS64.com.

https://ss64.com/nt/for_f.html



thanks for your explanation, what I'm not understanding and would like to get my head round is which part of the script is telling it to scan only the subfolder as I'd be quite interested in modifying this so that it could instead of scanning the subfolders scan the subfolders-subfolders so in my example would result in 4 8 I'd hoped I could have worked this out myself but after some time trying a few different things, I'm not having much luck.
5602.

Solve : Batch Movement Simulator Help?

Answer»

Ok, so I am working on a "game" written in batch and I came across a problem. I'm just showing a smaller example of the game to reduce confusion and unneeded coding. So, in a display that looks like:

#####
#O # #=All the walls
# # # O=Movable Character
# # Spaces=Area to move
#####

I need to find a way to have the bold # be a wall which will keep the character (O) to stay where is was at when you directed it towards it. It would look something like this:

##### If I made the "O" go right,
# # it would hold that position.
#O# # I want the "O" to hold it's
# # position from the top,
##### bottom, and left of the # as well.

That is the problem though, because I can only assign it to go to a single place if the "O" is going to the #.

This is the example code which I am showing you:
Or just download it from here.

Code: [Select]@echo off
mode con cols=14 lines=7
title Test
color 0f
set position=7
call :layout
set a7=#
goto redir
:screen
cls
echo %A1%%a2%%a3%%a4%%a5%
echo %a6%%a7%%a8%%a9%%a10%
echo %a11%%a12%%a13%%a14%%a15%
echo %a16%%a17%%a18%%a19%%a20%
echo %a21%%a22%%a23%%a24%%a25%
goto :eof
:redir
call :screen
:prompt
choice /c wasde /n
if errorlevel 5 exit
if errorlevel 4 set /a position=%position%+1&goto ifcheck
if errorlevel 3 set /a position=%position%+5&goto ifcheck
if errorlevel 2 set /a position=%position%-1&goto ifcheck
if errorlevel 1 set /a position=%position%-5&goto ifcheck
:layout
set a1=Û
set a2=Û
set a3=Û
set a4=Û
set a5=Û
set a6=Û
set a7=±
set a8=±
set a9=±
set a10=Û
set a11=Û
set a12=±
set a13=Û
set a14=±
set a15=Û
set a16=Û
set a17=±
set a18=±
set a19=±
set a20=Û
set a21=Û
set a22=Û
set a23=Û
set a24=Û
set a25=Û
goto :eof
:ifcheck
if %position%==2 set position=7
if %position%==3 set position=8
if %position%==4 set position=9
if %position%==6 set position=7
if %position%==11 set position=12
if %position%==16 set position=17
if %position%==22 set position=17
if %position%==23 set position=18
if %position%==24 set position=19
if %position%==10 set position=9
if %position%==15 set position=14
if %position%==20 set position=19
call :layout
set a%position%=#
goto redir
If I was not clear enough, please tell me. I tried my best. -NathansswellThis is easy in languages like BASIC, C, C++, Perl, Python, and a bunch of others. Not sure how you are going to do this with limitations of Batch. I made similar ASCII type games in Basic and C many years ago and used an array and a bunch of IF statements to control the X,Y boundaries by which the character would move in, such as confined within all your hashes in yoursetup. Also had to have collision detection to keep your character from being able to occupy the same space as other "solid" objects in the 2D ACSII Game. MAYBE this can be done in Batch, but its beyond my batching abilities. For me it would be way easy in these 5 languages I listed vs batch.

Looking at your code above it looks incomplete, such as missing :eof where the goto :eof is directing the next set of executions after set a25=Û, as well as missing a bunch of other sections. ( Maybe the clipboard chopped out a bunch of your code when copy/pasting it here to look at. ) * I am not a fan of downloading anything, so I will run it if all the source is here and I can visually inspect it for its intent before execution, and be able to copy it all direct to notepad and save as a test.bat file etc.
From what I see, you are never going back to prompt, so it isn't giving you the option to move more than once. This may or may not be the problem.Quote from: DaveLembke on December 20, 2012, 02:34:54 AM

Looking at your code above it looks incomplete, such as missing :eof where the goto :eof is directing the next set of executions after set a25=Û,

This is a nomal thing - in a batch script, you can CALL a colon+label subroutine just like you can call an external batch. The goto :eof (with a colon before eof) is a special thing equivalent to "return" from a GOSUB in e.g. BASIC. It takes you back to the line after the CALL statement.

REM main code
echo main code
call :subroutine
echo back in main code
goto end

:subroutine
echo in subroutine
goto :eof

:end

http://www.robvanderwoude.com/call.phpAfter thinking too much, I finally figured it out! Grazie amici! The sad part is, I don't know any other languages other than batch still.. But it works, so I'll still use it.I'm trying basically the same thing but without restraints to going right and down. This is what i have...

@echo off
@setlocal EnableDelayedExpansion

set y=0
set x=0
set space=
echo []

:0
set errorlevel=0
choice /c wasd /n
if %errorlevel% equ 1 (
set y=%y%-1
if %y% equ -1 set %y%=0
)
if %errorlevel% equ 2 (
set x=%x%-1
if %x% equ -1 set %x%=0
)
if %errorlevel% equ 3 (
set y=%y%+1
)
if %errorlevel% equ 4 (
set x=%x%+1
)


set height=%y%
set length=%x%
set arm=
cls

:y
if %height% equ 0 goto x
set height=%height%-1
echo.
goto y

:x
if %x% equ 0 goto 1
if %length% equ 0 goto z
set length=%length%-1
set arm=%arm%%space%
goto x

:z
echo %arm%[]
goto 0

:1
echo []
goto 0



Its supposed to work by generating your position every time you press wasd but it doesn't work.
5603.

Solve : DOS/4GW 2001 error?

Answer»

Hello.

I'm getting a DOS/4GW 2001 error when trying to start "Star Wars: Dark Forces" in MS-DOS. It says 07h (device not available). It does not happen in Windows. No matter which drive I try to load the game on, it does this frequently, but sometimes the game runs in DOS. Stonekeep also uses DOS/4GW, but when I attempt to run it directly in DOS, it never fails to run as long as the sound settings match the sound card. Stonekeep's disc is in like-new condition, while Dark Forces has some mild scratches and was buffed in the past. What could the cause be?Sorry for the bump, but does anybody have an idea of what I could do to fix the above problem?If the disc has visible scratches you need to buff out the scratches.
Look on You Tube for help on how to buff out scratches from a CD or DVD..
Here is one.
https://www.youtube.com/watch?v=F9_L9bGY1r8
- You need a banana. Quote from: Ryan on NOVEMBER 30, 2018, 08:38:16 PM

Sorry for the bump, but does anybody have an idea of what I could do to fix the above problem?
It was literally the 2nd THREAD in the forum. Pretty shameless.
5604.

Solve : Can i call a config file from batch file and username/password from prompt?

Answer»

Hi Kudos,

I have an issue with my deployment file(batch file) which is already automated but there are some steps in that. Which i would like to get it automated.

I have my server details in a environment.properties file which i normally call it from my BATCH file. Problem is that, there are server details with username and PASSWORD and every time i need to comment out other servers in order to deploy the file in any of 1 server and same for username/password too.

I am thinking to create 1 config file which will contain all the server details with their port excluding username/password. I will make a prompt for username/password for security purpose.

Example:
Below is my environment.properties file which i call it from my automated batch tool for PICKING server details with their password.

#Env1.
#servername=facebook.com

#Env2.
#servername=gmail.com

portnumber=1111
sslenabled=false

fipsenabled=false
#input and output is a part of deployment step which i just for copy and pasting files
input=in.xml
output=out.xml
#the below is the one would like to ask for prompt
username=admin
password=admin

So the above file can contain more than 2 server details and same for password. so i need to un-comment the server in order to deploy the file in the respective server. Can i create environment.config file, i heard that is more friendlier than this.

I know, its a bit LENGTHY but if someone have an idea of doing this will be much appreciated. I will upload if i may able to create config file.

Thanks Kudos !!

5605.

Solve : Can I make a .VBS run like a DOS command?

Answer»

HI

I have the following script given to me as a .VBS file but im trying to get it to run as a .BAT file as I need it to show it running and transferring files as you do on the DOS when you run .CMD file. Can this be done?

Code: [Select]Option Explicit

' Global variables
Dim strBaseDir, strDestDir
Dim objFSO, objFile
Dim arrFiles(), i
Dim lngFolderSize, intFolderNumber, strNextDir, intMoveFile

' Define paths to work with
strBaseDir = "B:\EE\EE29124343\base"
strDestDir = "B:\EE\EE29124343\dest"

' Set maximum size of new folders
Const cMaxFolderSize = 500000000

' Define class that will hold file information
Class File
Public lngSize
Public strPath
End Class

' CREATE file system object
Set objFSO = WScript.CreateObject("Scripting.FileSystemObject")

' Fully resolve paths
strBaseDir = objFSO.GetAbsolutePathname(strBaseDir)
strDestDir = objFSO.GetAbsolutePathname(strDestDir)

' Make sure the folders exists, exit if not
If Not objFSO.FolderExists(strBaseDir) Then
WScript.Echo "*ERROR* Folder does not exist: """ & strBaseDir & """."
WScript.Quit
End If
If Not objFSO.FolderExists(strDestDir) Then
WScript.Echo "*ERROR* Folder does not exist: """ & strDestDir & """."
WScript.Quit
End If

' INITIALIZE array index variable
i = -1

' Load info for each file into array (using File class)
For Each objFile In objFSO.GetFolder(strBaseDir).Files
' Don't include any files with size greater than max allowed in a folder
If objFile.Size > cMaxFolderSize Then
WScript.Echo "*WARNING* Skipping file: """ & objFile.Path & """, size:""" & objFile.Size & """ exceeds maximum folder size:""" & cMaxFolderSize & """."
Else
' Add another element to the array of type File class
i = i + 1
ReDim Preserve arrFiles(i)
Set arrFiles(i) = New File

' Store the size and full path to the file
arrFiles(i).strPath = objFile.Path
arrFiles(i).lngSize = objFile.Size
End If
Next

' If no files found then exit
If i = -1 Then
WScript.Echo "*WARNING* No files found to process."
WScript.Quit
End If

' Sort the files arrary by size in descending order
SortArray arrFiles

' Process all files moving to new subfolders until done
intFolderNumber = 0
Do
' Start a new destination folder and create it (MUST NOT ALREADY EXIST)
lngFolderSize = cMaxFolderSize
intFolderNumber = intFolderNumber + 1
strNextDir = strDestDir & "\" & intFolderNumber & "\"
objFSO.CreateFolder strNextDir

' Move files to dest folder until full
Do
' Look for the largest file left that will fit in remaining space
intMoveFile = GetFileToMove(arrFiles, lngFolderSize)

' If we found another file to move then move it
If intMoveFile <> -1 Then
Wscript.Echo "*DEBUG* Dest:[" & intFolderNumber & "], Available:[" & lngFolderSize & "], File:[" & arrFiles(intMoveFile).strPath & "], Size:[" & arrFiles(intMoveFile).lngSize & "]."
objFSO.MoveFile arrFiles(intMoveFile).strPath, strNextDir
lngFolderSize = lngFolderSize - arrFiles(intMoveFile).lngSize
arrFiles(intMoveFile).lngSize = -1
End If
Loop Until intMoveFile = -1

Loop Until AllFilesMoved(arrFiles)

Function GetFileToMove(ByRef arrArray(), lngSize)
' FIND next largest file to move that fits, -1 if none found
Dim i
GetFileToMove = -1
For i = LBound(arrArray) To UBound(arrArray)
If arrArray(i).lngSize <> -1 Then
If arrArray(i).lngSize <= lngSize Then
GetFileToMove = i
End If
Exit Function
End If
Next
End Function

Function AllFilesMoved(ByRef arrArray())
' See if all files have been moved
Dim i
AllFilesMoved = TRUE
For i = LBound(arrArray) To UBound(arrArray)
If arrArray(i).lngSize <> -1 Then
AllFilesMoved = False
Exit Function
End If
Next
End Function

Sub SortArray(ByRef arrArray())
' Sort array of files by size, descending order (simple bubble sort)
Dim i, j, intTemp
For i = LBound(arrArray) to UBound(arrArray)
For j = LBound(arrArray) to UBound(arrArray) - 1
' If arrArray(j).lngSize < arrArray(j + 1).lngSize Then
If LCase(arrArray(j).strPath) > LCase(arrArray(j + 1).strPath) Then
Set intTemp = arrArray(j + 1)
Set arrArray(j + 1) = arrArray(j)
Set arrArray(j) = intTemp
Set intTemp = Nothing
End If
Next
Next
End SubQuote

as I need it to show it running and transferring files

Is this homework?

the VBS can be called from the batch or even generated dynamically within the batch to write an output to a .vbs file and then that .vbs called from batch, but batch execution will still be a batched environment and the .vbs script will still be the vb script environment.

Not sure why you cant just run the .vbs unless your trying to get around some sort of block that disallows execution of .vbs files to which what you have going on in the .vbs would have to be all handled by batch alone and batch has limitations and thats why people use other scripting languages as well as pair batch with other scripting languages to handle where batch ISNT well suited.No its not homework.

Tell you what it is im running the VBS no problem but it dosent show anything whilst it is running and there will be numerous people using it and im frightened that they will think nothing is happening and will close it. I just thought that a .BAT file would show it running or is there another way you can show a VBS script running.There are two script engines for running Visual Basic Script code (.vbs files)

wscript.exe (default) - no console window, scripts seem to run invisibly unless you have message boxes etc. Each Wscript.echo command shows a message box with an OK button. You have to click this before the script will move on.

cscript.exe - opens a console window. Each Wscript.echo command shows text in the console, just like the echo command in batch scripts. After it shows the text, it moves on straight away, without waiting.

You can Google to find out all about these, how to use them, etc. I have to tell you your script would need some changes before it would be any use under cscript.exe.
Many thanks that makes sense.

I think that I would be going more for CSCRIPT so I will google that and have a look.

Thanks
5606.

Solve : Help with configuring an industiral DOS system?

Answer»

First off, hello! I'm Albert, I'm a sci-fi nerd, and new to this forum (also, I'm hoping I'm posting this in the correct forum!).

My plant has some extremely outdated DOS (1985,refurbished in 1990s) computers running our Semi-automated Pick and Place machines , and one recently lost it's motherboard. I was able to find an exact replacement (it's a NixSys NX853, with a celron 2.40GHz, and 256 MB of DDR), but I can't get the machine to recognize it's normal touchscreen or keyboard- I have an alternate keyboard that's working, however.

That's not the problem, however. The problem is that it won't boot into the proprietary machine software, which runs on top of DOS, instead giving me an "Error 8- there is not enough memory available" when initializing the network card (picture below). The memory installed is the same size and make as the original, and I tried swapping out the new memory with the board for the old, but no dice.

I looked it up, and what I saw suggested it was an error in CONFIG.SYS, so I mucked about with that for a while, and eventually got it to give me something else- "Error 3658- the IFSHLP.SYS driver is not installed."

I looked it up again, and google suggested that adding "DEVICE=C:\Windows\IFSHLP.SYS" to the CONFIG.SYS might fix things. It brought me back to the "error 8" problem again.

I've noticed a few things-

-The only hard drive is configured as slave, rather than master. Could this be fouling things up? (there's also a floppy drive, but it's currently unplugged.)
-The proprietary machine software requires an internet connection, which is why it's not running. I believe the problem is local to this machine, since the older, non-refurbished machine runs fine. Could it be something in the networking configuration that shipped from the factory that's messing up the connection, causing the driver to use up memory?

Fair warning- I'm not the greatest computer geek. I'm just my company's ONLY computer geek. So if I sound like an idiot- well, I am, when it comes to these things. If anyone can help me, I'd extremely appreciate it (my boss is starting to breathe down my neck about this)!

Memory error could be BASE Memory Complaint.... when you run the command MEM how much base memory is free after it loads all the TSR's?

It should show your base memory and then how much is free. I use to have problems with some older programs when the base memory dropped below 590k from 640k.

Were you sure to keep the Autoexec.bat and Config.sys files the same config as the prior build so that himem.sys ( for XMS memory functionality ), emm386.exe, and other configurations would remain the same?

Which Version of DOS are you using? ( if you enter VER at the command prompt it should tell you if you dont know )


Additionally if your running strictly DOS and not Windows its only touching a very small amount of that 256MB with most of it unused and un-addressable from DOS.

The Celeron 2.4Ghz with 256MB RAM is very overkill for what your software does if its strictly DOS and not Windows. I am surprised your not running into issues with Serial Port communications and proprietary cards that are ISA that are unsupported with the motherboard.

20 years ago I use to service Contact Systems CS-400E PCB Assembly Machines... Your screenshot looks similar to that system. Rockwell Automation/Allen-Bradley sent me to Danbury, CT for training on supporting and servicing them. https://www.youtube.com/watch?v=0FARnjIP-5k

Only big problem we had with the CS-400E was the parts bin that lifts and turns trays into position for PCB Assembler to reach in and grab components would sometimes catch and when it released from the snap it would SPIN and whip parts out of it all over the floor. Additionally operators running it with jewelry or very light skin with bright overhead lighting would defeat the light curtain safety and so some people have gotten their fingers pinched. The solution was operators needed to wear a black glove so the light curtain wouldnt get tricked into no hand present.

If my memory is correct on the CS-400E it was running DOS 6.0 or 6.22 and a 486 DX 66Mhz CPU. We got them in 1995 and when I was laid off in 2001 I serviced them on the side for other businesses that had them as well as the older C and D models.
Yep, it's a CS-400E. (So cool that you actually trained on fixing them!! ) Based on archived information I've found out on the internet, the factory refurbished some of them, and replaced the computer with the NixSys NX853/Celron, because that's what was in it and running when we bought it from our parent company . I don't think I'm running into any issues with the cards? Like I said, I'm not that great with this stuff.

I didn't touch Autoexec.bat, and I made a copy of Config.sys before I started mucking around with it (there's also a backup copy on the computer.) Also- correction. The line I had added was DEVICE=C:\NET\IFSHLP.SYS. There isn't a windows folder on the drive.

Our SAPPS are actually fairly docile- I think they have pinched someone's hand once in the last four years, but I'll have to remember that trick with the glove in case they decide to start. However, ours have their own unique problems- they're set between the wave solder machines and the SMT solder ovens, across from the board washing plant. Background noise hovers around 60 dB on a good day

I'll attach screen-shots when I get home, but it looks like there's 431K conventional and 13K upper memory free, and it's version 6.22.

Thank you for helping with this!

Is this the only CS-400E that you have? ( If you have another available you can copy the autoexec.bat and config.sys from a known good state system to this system via the floppy drive that should be located under the keyboard section. )

Additionally unless you really need this networked, you could run this offline and free up base memory by not having the drivers running as TSR's. Base memory is the first 640k of your system RAM. Everything there after is Extended Memory to DOS. If your base memory is too low then programs that require running in base memory will fail and give memory errors of not enough memory even though the system has clearly more than enough.

We had 2 of these CS-400E's and updates were performed manually through the table jog and selection for spacing and polarity pin blinking etc, and programming process which then was saved to 1.44MB Floppy Disk and of which could then be shared with the neighboring CS-400E. Additionally they ran offline as stand alone units and weren't connected to network. So if your able to run these offline, then I'd remove the lines that mount the networking drivers and this will boost your base memory and then it might work for you.

Are you familiar with servicing them and programming them for jogging the table and setting the cut & clinch inward/outward and lead length etc? If your employer is able to send you to Danbury, CT for training, ( if they still offer training on a 23 year old machine ), its so well worth the training. They cover everything from programming it to troubleshooting and fixing it.

Off subject below but might be interesting:

While at Rockwell Automation/ Allen Bradley in Lebanon, NH from 1995 to 2001, I assisted with PCB Production and worked in the Service Department as a Senior Electronics Technician servicing the production boards that failed testing as well as units that people blew up in the field. Going to training was just a 3 hour drive to CT down US 91 South to 84 West. Training for me and another guy was like $2500 each for a 4 day training with their engineers and technical instructors at Contact Systems.

I did pretty much everything there on the production side of things Wave Solder Operator, PCB Assembler on a bench with racks of PCBs and a BOM or by use of the CS-400E's, QC, Rework, Post Wave Assembly, Testing, and Troubleshooting and Fixing, as well as worked with engineering to test new products or new firmware etc, as well as assist them in troubleshooting why a new board spin wasnt working to which it was either a mistake in the design that required them to drill or grind out boards and make a break in an incorrect trace and then leave the drill hole or fill the PCB with epoxy to mask the altered trace. Other fun was in extreme temperature testing with a room that baked boards and products at 150F for 24 hours as well as we would test samples of chips with canned air held upside down to chill chips to see if they are susceptible to extreme cold making them wig out.

Being a jack of all trades and a sponge for as much overtime and opportunities that they sent my way was very beneficial there.

In one situation a Senior ET was out on leave and I saw a need to help out. I created my own boards that made my production test job easier and faster, and I would use my spare time to be helpful. Well work that should have taken 3.5 hours I got done in 1 hour because I made a serial splitter board with opto-isolators driving the serial communications to more than one controller at a time. So instead of downloading over 9600 baud serial to one controller I was mass downloading to 8 at a time. I basically was testing to see if I had one controller connected for RX/TX and others as RX only if a group of same systems at 9600 baud would all successfully get the same download. They did because the TX response from the ones that were RX only from my 8 splitter board were handshaking at the same timing as the single controller in the chain that was both TX/RX. I did this without telling anyone with spare chips I had. All the ETs made their own trick boards and I made this as a 8 controller download splitter.

So long story short, I went home on my lunch break and brought in a old 8088 XT computer and installed the companies test program called Accell to it, and set myself up with an area to grab failed boards and service them. I didnt ask for permission and I basically gave myself a promotion to the position as Senior ET. This one woman named Carol in that department was very happy I came over and helped and the backlog of products to fix were all getting fixed. Come friday though I got caught!

So they said how did you have time to do both jobs. So I shared with them the Serial Splitter board I made, and demonstrated it to them in its perfectly functional and safe to product state. Then i said with my extra time I made by making a long process shorter for testing where the serial download was a long process added up single downloads at a time, that i was able to perform 8 downloads in the time that 1 download took to the controllers known as IMC S-Class Controllers. I decided to take this extra time I made for myself and give it to the benefit of the company by bringing in a spare old computer from home and going to use my skills that the company hasnt really tapped into the full potential of.

I thought I was going to get fired that day. But the plant manager met with me and ran me through a drill of questions. Then the head engineer came in with a grin and asked me questions. Then the engineer got the plant manager to come back in and there was the longest 15 seconds of silence that i was breaking a sweat thinking this is it, im getting fired.

To my surprise the plant manager stated that this situation is a difficult one and Im thinking here we GO im fired. He said you took it upon yourself to do a job that isnt your job, but you clearly have the skill set to do the job as Carol thought you were sent to her from your boss to assist and you weren't but you pulled us out of a backlog of broken products and you fixed them all correctly. So another 15 second pause and then how would you like to be a Senior Electronics Technician and get a $5 an hour raise to $13.50 an hour from the $8.50 an hour you were making... WOW ( That was good money back in 1996 )

YES! ... They then said you broke so many rules and regulations that you should have been fired. But because you saved the company from angry customers waiting for their products to be fixed we ( plant manager and head engineer ) feel that you should be rewarded with the position that you obviously have an interest in. However ... the computer you brought in from home and used here with the company software installed on it needs to be wiped clean and that has to leave here immediately! I said I will format the hard drive and show you that no company software leaves this building, however if you want to keep the 8088XT you can as well because it was just a spare of mine. He grinned and this was unusual of a MAN who was always serious and stern, and said we can buy a new computer and we dont have any need for donated computers being the multi billion dollar company that we are.

So not suggesting at all that you copy my path of self promotion, because it would likely lead to losing a job vs getting a promotion but thought you might find that interesting.

When the Office Space movie came out and they had the "Meeting with the Bobs Promotion scene"... people who knew me and the situation at work getting promoted where most would be fired for pulling what i pulled, additionally i had late attendance issues laying in bed with alarm clock going off with boss calling at home asking if I am coming into work today. I was very much like Peter.

I've corrected my behavior though since then to be more professional and on time as well as not do anything at the risk of getting fired.

I now service and fix automation machinery for the United States Postal Service's letter and package sorting machinery as a Level 10 Electronics Technician at $72,000 per year base salary with some co-workers making 6 figures that enjoy overtime. I made $94,000 last year from soaking up some overtime and been here 9 years. A good job that pays well and good benefits. If your good with electronics the USPS has a need for skilled Electronics Technicians and starting salary is around $60,000 per year. They also dumbed down the 955 Test that is used for Testing for Potential Electronics Technicians.

Our site in White River Junction, VT has a need for a Electronics Technician for 11pm to 7:30am shift and it hasnt been filled yet and its been vacant for 1.5 years. And other sites are also hurting for skilled Electronics Techs. They really need skilled ET's and so if your in the USA and good with basic electronics which is the requirement to pass the test. You could get hired and probably make more than your making at your current job.

Hi Albert

From the screen shot you posted either the controller was booting from a combination of the Hard drive and a floppy disk or the hard drive has read errors. The drive should be master or cable select depending on the IDE cable if it is the only drive on the cable then set it to master.

To test the hard drive you could use MHDD from here http://hddguru.com/software/2005.10.02-MHDD/
It will run from floppy disk.
If the floppy drive had a 3com floppy disk in it this may be needed to get the files needed to start dos networking. And could be the errors of drive not ready.
Also Check in the bios on one of the earlier machines that there isn't a page of memory reserved. If there is then you will need to reserve the same address range.
I always photograph all the bios settings as well as do a complete backup of any drives. Just encase you need to replace the motherboard or re setup the bios.

The original motherboard what was wrong with it? if it was just the capacitors you should be able to get these replaced

5607.

Solve : Beginner batch password system?

Answer»

You NEED a SPACE between the RIGHT PARENTHESES and ELSE.or else...

5608.

Solve : Need Help with word Batch File to open multiple Documents?

Answer»

I wonder if anybody can help me... bit of a long request!

So, I need to open multiple word documents, all located in different folders with different names.

Example:

S:\ASOS\Operations\Service Reviews\2018\11 November 2018\Asos Daily Service Review 04.docx
S:\Bidvest Logistics\Operations\Service Review\2018\11 November 2018\Best Food Daily Service Review 04.docx

I have tried several different commands but had no luck what so ever!

Also, it would be HELPFUL if I could GET it to open the document at the bottom of the list. They are changed daily so go Review 04, Review 05, Review 06 so on so forth.

So ESSENTIALLY, something that says:

Go S:\ASOS\Operations\Service Reviews\2018\11 November 2018
Open the bottom word document
Go S:\Bidvest Logistics\Operations\Service Review\2018\11 November 2018\
Open the bottom word document


I know it's a long request but I am stuck and hoping someone can help me!

Thanks in Advance!Even if we can just get it to open any of the documents, I can go in and change the numbers manually each time!

ThanksReal easy to open a word document with a BATCH file if the file associations are setup correctly.
Code: [Select]start "" "S:\ASOS\Operations\Service Reviews\2018\11 November 2018\Asos Daily Service Review 04.docx"
start "" "S:\Bidvest Logistics\Operations\Service Review\2018\11 November 2018\Best Food Daily Service Review 04.docx"And yes you should use the leading set of empty quotes.

That is pretty much all you can do. Batch file cannot interact with Graphical User Interface programs.Hmm, strange... I'm 99% sure I had tried this code twice already as I thought the same, it was simple hahah, either way, the code you provided works perfectly.

Thanks for your help, as simple as it was haha! Issue Resolved
- Thanks

5609.

Solve : Batch file to unzip files onto another drive?

Answer» HELLO,

My 7z zip is installed on C:\Program Files\7-zip, but I need to unzip a file on E:\. I've added the 7z path to environment variables, but no go. Here's my bat file:

@echo off
SET "SOURCE=%E:\WWtesting\Source%":
SET "TARGET=%E:\WWtesting\Target%":

for %%I in ("%SOURCE%\*.zip") do (
"%C:\Program Files\7-Zip\7z.exe" X -y -o"%TARGET%\" "%%I"
)

How do I get the bat file to run 7z from C: and unzip it on E:?
No clue where you found syntax for using percent symbols and colons like that.

Code: [Select]@echo off
SET "SOURCE=E:\WWtesting\Source"
SET "TARGET=E:\WWtesting\Target"

for %%I in ("%SOURCE%\*.zip") do (
"C:\Program Files\7-Zip\7z.exe" x "%%I" -y -o "%TARGET%\"
)Howdy Squash...all good on yer end ? ?Quote from: patio on November 01, 2018, 05:30:34 PM
Howdy Squash...all good on yer end ? ?
Yeah, but I will probably throw a few back a few this weekend in honor of Foxidrive who passed away two years ago this Saturday.He is missed...He is missed and the help he gave still lives on in scripts etc that he assisted with. At WORK one such script he surprised me with his creativity in a system that cant have any software brought in on media and so limited to what ever you can do from command shell and notepad in NT4 environment on an old Pentium III 700Mhz and the script he helped GREATLY with creates a QBasic (.BAS file ) dynamically through batch and then it calls to execute this QBasic program to do what was beyond what batch can do alone.

We run this batch file that dynamically creates the QBasic programs to run through iterations for all files with specific file extensions at a target directory once a week and it saves from having to manually change text files that are used for machine configurations. It use to be 30 minutes to manually edit in notepad about 50 text files to switch a parameter within the text files from "N" to "Y".

This script he gave me saves us about 2 hours a month not having to manually edit text files and we have been running it for about 2 years now. What use to take about 30 minutes manually is completed in 10 seconds every sunday morning after the machine gets its weekly configuration updates passed down to it from another system where a site controller isn't able to make the N to Y change and engineering simply stated why don't we just manually edit the config files for changing N to Y ... But engineering wasn't going to ADD a button with a function to do that from the site controller software. But Foxidrive gave me the ability to manually type the batch files on that system and create them which was within the rules of what I could and couldn't do from my boss, since I was told I can do any coding as long as nothing is brought in on CD, Floppy, or other media due to system security concerns where they don't want any virus etc coming in from the outside, however whatever you can manually type and save as a .bat file extension in the system is fair game. Let's all tilt one for him this weekend...

He would just laff...
5610.

Solve : Need batch for getting PC mac address and compare on a maclist.txt?

Answer»

i was HOPING to RESTART PC if MAC ADDRESS is not on a maclist.txthttps://stackoverflow.com/questions/52940358/need-batch-command-getting-mac-address-and-compare-on-a-txt-file

5611.

Solve : help rar commans on windows CLI?

Answer»

hello there
i am using cobian backup for shelude
i am using dos (XCOPY) backup with your help

yes... very good backuping subdirectory with sheluder

i need pack this subdirectury
and i wanna use rar.exe (in windows server path)

my backup path f:\Yedek
subdiretory names smilar



i am PACKING manualy... day by day packing with WINRAR for small size
that is only one program backup subdirectory
have more

my need,

how i can pack subdirectory with same name than delete this packed subdirectory with no problem ?

but dont ask or command when delete subdiretory.. must be auto complate

i check rar commands but dont understand it. because i need subdirectory names for new pack files than i must delete it

more than..... (pack FINISHED all subdiretories.....)
can be move all rar-ed files toooooooo Z:\...\... (special path - other disk) ?

dont need extract. only need pack with rar.exe

could you help me ?

find it.... but, including main directory and adding subdiretory.. mean... test\_sub_dir\_files_

how i can fix it ?

@echo off
SET PATH=%PATH%;C:\Program Files\WinRAR

FOR /L %%G IN (1,1,3) DO (

CD f:\test

FOR /D /R %%G IN ("*") DO (

ECHO This is %%G

WINRAR a -afrar -df %%G %%G

)
)


5612.

Solve : Disk Drive Recognized in Windows, but not DOS?

Answer»

I just bought an IBM Thinkpad T42 that is running Windows 98. I want to play some of the MS-DOS and Windows games that I have, but are too old to run on Windows 10. So far every Windows game I've tried has worked, however, I haven't been able to get any DOS game running. Am I doing something wrong? Here is what I do:

I have the system restart in MS-DOS, OPEN the disc drive, put a disc in, close the disc drive, type "D:" to switch to the disc drive (that's the correct drive letter, I checked), but I get a message that says "Invalid drive specification".

When I run MS-DOS in Windows 98 and do the same steps the drive is recognized and it switches to that drive. Any idea what might be going on? Any ADVICE helps, I'm out of my DEPTH in all this.When you say you put "put a DISK in", do you mean a CD or DVD? Into an optical drive? If so, are you loading MSCDEX when you start MS_DOS?

5613.

Solve : Batch: xcopy /D repeatedly copies old files?

Answer»

I have a script that performs a delayed synchronisation of data files from an industrial pc running Windows XP to a NAS box (QNAP TS-110). I have been testing this script on my computer (also running XP [-pro 2002 S.P.3]), with the NAS mounted as a network drive (192.168.10.122 -> Z:\).

I have run the script sequentially to make sure it behaves as expected. My "test" folder contains a few sub directories and a number of files of different types. However, from a reading of my "Log.txt" file, while it copies most files from my "test" folder only once, some files it copies repeatedly. On a colleague's computer (also XP pro) it consistently copied a number of .jpg files, on mine it consistently copies one .txt file.

As far as I can tell, there does not appear to be any pattern to this behaviour. We have tried tweaking the clock on the NAS to see if this makes any difference, but to no avail. We have also tried various combinations of the switches to see if some interaction between them is causing the unexpected behaviour, but this has not worked either.

We have considered installing a version of RoboCopy and using that, but I am kinda hoping that this will not be necessary, and that I have just missed something simple.

My code is:
Code: [Select]@echo off
title NAScopy02

REM note: Timeout.exe must be in the same directory as this file to work correctly!

REM (1)
Timeout 5
set today=%date%

REM (2)
ping 192.168.10.122 -n 1 | find /i "bytes=" || goto Fail01
set now=%time%
echo %today%, %now%, 192.168.0.122 >> "Log.txt
xcopy test Z:\test01 /D /E /I /H /Y >> "Log.txt
:Fail01

REM (3)
ping 192.168.10.1 -n 1 | find /i "bytes=" || goto Fail02
set now=%time%
echo %today%, %now%, 192.168.0.12 >> "Log.txt
xcopy test test01 /DEIHY >> "Log.txt
:Fail02

REM (4)
ping 192.168.10.1 -n 1 | find /i "bytes=" || goto Fail03
set now=%time%
echo %today%, %now%, 192.168.0.13 >> "Log.txt
xcopy test test01 /DEIHY >> "Log.txt
:Fail03

REM : use loops!
@echo on


My Log.txt reads:

27/07/2011, 17:51:41.65, 192.168.0.11
test\2011 06 22 0000 (Float).DAT
test\test_files\DSC_2074.JPG
test\test_files\DSC_2077.JPG
test\test_files\DSC_2081.JPG
test\test_files\DSC_2083.JPG
test\test_files\DSC_2084.JPG
test\test_files\DSC_2096.JPG
test\test_files\DSC_2099.JPG
test\test_files\subfolder1\Subfolder1dash1\yo_mama.txt
test\test_files\test files 2\DSC_2074.JPG
test\test_files\test files 2\DSC_2077.JPG
test\test_files\test files 2\DSC_2081.JPG
test\test_files\test files 2\DSC_2083.JPG
test\test_files\test files 2\DSC_2084.JPG
test\test_files\test files 2\DSC_2096.JPG
test\test_files\test files 2\DSC_2099.JPG
test\test_files\test_folder\test.txt
17 File(s) copied
27/07/2011, 17:51:59.72, 192.168.0.12
0 File(s) copied
27/07/2011, 17:52:00.06, 192.168.0.13
0 File(s) copied
27/07/2011, 17:53:16.19, 192.168.0.11
test\2011 06 22 0000 (Float).DAT
1 File(s) copied
27/07/2011, 17:53:16.69, 192.168.0.12
0 File(s) copied
27/07/2011, 17:53:17.01, 192.168.0.13
0 File(s) copied
27/07/2011, 17:53:27.06, 192.168.0.11
test\2011 06 22 0000 (Float).DAT
1 File(s) copied
27/07/2011, 17:53:27.51, 192.168.0.12
0 File(s) copied
27/07/2011, 17:53:27.83, 192.168.0.13
0 File(s) copied


Any help with this (now frustrating) problem would be Appreciated.

Dan



This comes from the XCOPY help:

/D:m-d-y Copies files changed on or after the specified date.
If no date is given, copies only those files whose
source time is newer than the destination time.


Perhaps things have changed, but is this even legal: /DEIHY Thought each switch had to be preceded by a forward slash so the interpreter could parse them correctly.

Don't see any glaring errors, so fix up the switches (the first XCOPY is correct) and see how it goes.

Your right of course, but the first xcopy is the only one that's used at the moment, the others don't get used coz the IP's to be tested before they are executed are dummies, and so the script skips to the Fail point. The Log.txt output is consistant with this, and shows that it is the first xcopy that is giving the problem in any case.Quote from: donOpenHydro on July 28, 2011, 10:08:04 AM

Your right of course, but the first xcopy is the only one that's used at the moment, the others don't get used coz the IP's to be tested before they are executed are dummies, and so the script skips to the Fail point. The Log.txt output is consistant with this, and shows that it is the first xcopy that is giving the problem in any case.

Actually, using bytes as the search argument for the find command is a poor choice.

Unsuccessful Ping
Code: [Select]Pinging 192.168.2.4 with 32 bytes of data:

Request timed out.
Request timed out.
Request timed out.
Request timed out.

Ping statistics for 192.168.2.4:
Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),

Successful Ping
Code: [Select]Pinging 192.168.2.3 with 32 bytes of data:

Reply from 192.168.2.3: bytes=32 time<1ms TTL=128
Reply from 192.168.2.3: bytes=32 time<1ms TTL=128
Reply from 192.168.2.3: bytes=32 time<1ms TTL=128
Reply from 192.168.2.3: bytes=32 time<1ms TTL=128

Ping statistics for 192.168.2.3:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms

Bytes is present on the first line issued by ping no matter what the state of the connection. Try using a better argument so you can differentiate the connection status. (TTL will work).



Well, I didn't really know what I was doing with that! Anyway I fixed the switches, and changed the find argument to "TTL", and I still had the same problem. I TRIMMED the code down to one IP sequence for testing, and it still behaves the same way!

Code: [Select]@echo off
title NAScopy03

REM note: Timeout.exe must be in the same directory as this file to work correctly!

REM (1)
Timeout 5
set today=%date%

REM (2)
ping 192.168.10.122 -n 1 | find /i "TTL=" || goto Fail01
set now=%time%
echo %today%, %now%, 192.168.0.122 >> "Log03.txt
xcopy test Z:\test01 /D /E /I /H /Y >> "Log03.txt
:Fail01

@echo on


Log03.txt:

28/07/2011, 18:50:26.18, 192.168.0.122
test\2011 06 22 0000 (Float).DAT
test\test_files\DSC_2074.JPG
test\test_files\DSC_2077.JPG
test\test_files\DSC_2081.JPG
test\test_files\DSC_2083.JPG
test\test_files\DSC_2084.JPG
test\test_files\DSC_2096.JPG
test\test_files\DSC_2099.JPG
test\test_files\subfolder1\Subfolder1dash1\yo_mama.txt
test\test_files\test files 2\DSC_2074.JPG
test\test_files\test files 2\DSC_2077.JPG
test\test_files\test files 2\DSC_2081.JPG
test\test_files\test files 2\DSC_2083.JPG
test\test_files\test files 2\DSC_2084.JPG
test\test_files\test files 2\DSC_2096.JPG
test\test_files\test files 2\DSC_2099.JPG
test\test_files\test_folder\test.txt
17 File(s) copied
28/07/2011, 18:50:48.82, 192.168.0.122
test\2011 06 22 0000 (Float).DAT
1 File(s) copied
28/07/2011, 18:50:52.46, 192.168.0.122
test\2011 06 22 0000 (Float).DAT
1 File(s) copied
28/07/2011, 18:50:55.51, 192.168.0.122
test\2011 06 22 0000 (Float).DAT
1 File(s) copied
Still have a few ideas:

Add the /L switch to the XCOPY and run it from the command line. This will produce a list of files on a what-if basis but not actually copy any files.

Run a dir against the souce directory on the local machine and the destination directory on the NAS. Be sure to use both the /s and /tc switches on both.

This should give you enough data to manually check which files should be copied and which shouldn't. Remember the /d switch on the XCOPY without a date only selects files with a source time newer than the destination time.

Good luck.
dir /tc shows that the source file is older than the directory file
Incidentally /ta & /tw do no better at highlighting any problems.
In fact, testing seems to indicate that xcopy seems to respond to changes reported by dir /w.
xcopy /L just shows up the same poor behaviour in the log file.
If I modify the destination file, the script behaves as it should.
The only ray of light is that if I leave a gap of 5 mins between sequential runs of the script, dir on the destination shows no changes in the dates of the files. Is it possible that the output from xcopy is buggy, and that there is no actual copying GOING on? I think th only way to show that would be to monitor network use on the NAS box.
Maybe its time to call it a day and use a different tool.If I understand this correctly, you want the NAS files to sync to the local machine on a regular basis.

If you were to create an exact copy of the files and structure of the files on the NAS, you would then have a baseline. As files change on the local machine, the modification date will get updated making the source time newer than the destination time. The file should then be eligible for inclusion the next time XCOPY is run with the /d switch.

Another method might be to key off the archive bit. When a file is changed, the archive bit is set on, and XCOPY can recognize this with the /m switch. After the copy the /m switch will flip the archive bit off saving you a separate attribute operation.

Hope this gives you some alternative ideas. I see nothing obvious - but I don't always trust incremental backups. At least once a month, I would do a complete backup of all of the data, whatever the file date or whether the archive bit is set on-or-off. That way you never loose more than a months work at a time.

I would also check the results - carefully at least the first few times.
I would use dir *.* > afile.prn for both directories then import into excel and check that both exist, File Size, File Dates.

Regarding the batchfile, can you add a couple of lines to it to copy 1) starting files (both From and To) and the resulting files (both From and To) and see it anything popouts. And save about a weeks work of these files for analysis.For years, I've been setting up backup solutions for myself and certain customers.

The Idea: Is to make sure that every file created, saved or changed on the C: drive is backed up to the second hard drive as an active backup. So I wrote the most simple batch file I could, using XCOPY to make sure that no data file went un-backed up.

The batch file can be run manually from a shortcut, or from a shortcut in the STARTUP folder or from a simple batch file that runs MS-Word (for instance) and then runs a backup to save the new file to the backup drive.
The task scheduler can be used to run the batch file too, however that's never been my favorite way to do anything.

My batch file to run WordPerfect and then backup the result, goes like this:

@Echo off
cls
call "C:\Corel\Suite8\Programs\WPWIN8.EXE"
"C:\Documents and Settings\Alexi\desktop\Update\XCOPYDocs-Mail to D.bat"

the last line, just runs an existing batch file to backup all my documents, when WordPerfect finishes.

The backup batch file run above actually looks like this:

@Echo off
cls
xcopy "C:\Documents and Settings\Alexi\My Documents\*.*" "D:\My Documents\" /s /y /H /R /D
Rem: Backup my WordPerfect files
xcopy "C:\MyFiles\*.*" "D:\MyFiles\" /s /y /H /R /D
Rem: Backup all my saved eMails
xcopy "C:\Documents and Settings\Alexi\Local Settings\Application Data\Identities\{DA2A9331-88CA-4BF6-9B3D-22290B4CD50D}\Microsoft\Outlook Express\*.dbx" "D:\MyEmailFiles-Backup\" /s /y /H /R /D
pause


As Y'all can see, I don't do anything fancy, but I try to keep it as simple as possible. The first time the batch file runs, ALL files are backed up (copied) from the Source Directories, but on subsequent runs, only files that have changed or have just been created or saved, will be backed up. A daily backup only takes a few short seconds.

Cheers Mates!

Hi donOpenHydro,

Did this ever get resolved? I have same issue. I use Xcopy to copy files locally with no issues.. but up to a NAS I have same copy problem as you .. the same subset of files repeatedly get copied. I see this issue with xcopy on Windows XP, Vista and Windows 7 also tried various versions of robocopy.

There is definitely something odd happening when copying up to NAS (linux based). I'm quite familiar with Networking, OS's, batch files etc .. but this is odd. Like you listing directly with dir /tc/ta /tw do not show any difference between NAS and local directory listing .. but still continue to recopy certain (not all) files.

Any shining light would be appreciated
Maybe it has to do with the timestamp granularity as Linux boxes do things differently.

Test it with a Windows box on the LAN and if it doesn't recopy that file then you know where the problem is.I decided to register just to put a few updates on this as it's still highly indexed by a google search.

I'm having exactly the same problem with a much simpler batch script that's going windows -> windows on an old win7 desktop. The backup script seems to randomly choose how many files to copy over again or not. I've done similar troubleshooting steps to the above, including manually creating a new file (sometimes it gets copied, sometimes it doesn't). My only guess is that there's a process (AV? Windows defender/etc) that is doing the linux equiv of 'touching' the files which throws the timestamp off.

For my purposes it's not a big deal - my script runs daily after hours, so the only 'net loss' is a LITTLE more disk activity every night. Sorry for the gravedig, and I've been reading the forum for years!


5614.

Solve : Lotus 123 on Windows 10?

Answer»

Looks like Lotus 123 will WORK on WINDOWS 10This refers to the Windows RELEASE of Lotus 1-2-3 that is part of Lotus Smartsuite, and only applies to Smartsuite 97 and Smartsuite 2002.

5615.

Solve : Password removal - how??

Answer»

I created text in MS DOS then put a password on it. To print it out in Word, I used to remove the password, edit my doc, then save it. I now know the password but cannot open the Word docs by converting first to MS DOS as I'd done MANY times before, due to a library upgrade some years ago. It ACTUALLY tells me 'Document created by corporate program' (Not sure whether that means Corporate Program.)

More fool me for not putting the password on via a private machine if the library system is the problem. Worse, the library refused to let me have the old computer when they did their upgrade, otherwise I wouldn't have a problem now.

Is there any way I can convert a Word doc back to MS Dos to remove the password and open it?

Or do I have to advertise for an old machine? I have all the old HD disks plus what I tried to transfer to USB.

Please help!You need to just know the exact version of software that it was created under. Then install that software and then it should be the same as the old computer you had. You just need a software/file pairing and should not need a hardware/file pairing.

*Note: If this is an old 16-bit program the this file was created under you will need to run it through a 32-bit version of Windows. 64-bit versions of Windows no LONGER support 16-bit programs. Most people these days run dos programs through older 32-bit windows computers however maybe your computer is running DOS and DOESNT have windows in which 16-bit compatibility wont be an issue.

You stated you know the password, so you just need to know what program and version the file was created under. Buy that if you dont already have it, and then open that file by entering the password with the ORIGINAL software.

5616.

Solve : Joining multiple txt. files and adding part of file name to each row?

Answer»

Hi All,

I have a folder with multiple txt files in csv format with name convention Something_something_something_XXXXXXXX. txt where XXXXXXXX is date.

Now I need to join those files in one and each row needs to have a the date XXXXXXXX from respective file added as column.
So far I was able to find way to add whole file name to the row. I have found how trim file name to keep only XXXXXXXX.txt

But I am not able either to remove the .txt nor to add the trimed name to rows. Below is the code for adding name file:

for %%A in (*.txt) do (
echo Processing file '%%A'

FOR /F "delims=" %%L in (%%A) do (
ECHO %%L , %%A >> New.txt
)
)
I have found this to trim the file name so it leaves last 11 chararacters so XXXXXXXX.txt
SET VAR=%%A
CALL ECHO/%%VAR:~-11%%&ECHO/

don't know how to use it in ECHO %%L , %%A >> New.txt

I have seen the %~nA SUPPOSEDLY should return only file name so I could get rid of txt but could not find syntax that WOULD work.

This is probably easy but I am sooo... confused with examples I have seen that I can figure out how to join the dots. There are different ways to skin this cat. This splits the filename into tokens divided by _ and . and takes the 4th one, which is XXXXXXXX here.

Test it on copies of your files as it overwrites the original.

Code: [Select]@echo off
for %%A in (*.txt) do (
for /f "tokens=4 delims=_." %%Z in ("%%A") do (
echo Processing file '%%A'

FOR /F "delims=" %%L in (%%A) do (
ECHO %%L,"%%Z" >> New.tmp
)
move /y new.tmp "%%A"
)

)
Hi foxidrive

Worked perfectly - actually the files were Something-something_something-something_XXXXXXXX. txt but with your EXPLANATION I was able to figure out this detail myself.

Thanks a million!!Hi guys

I have came here through another forum in search of same topic. I found following code Code: [Select]@echo off
for %%A in (*.txt) do (
echo Processing file '%%A'

FOR /F "delims=" %%L in (%%A) do (
ECHO %%L%%A >> DataFile.txt
)
)
and used it in my batch file. It works perfectly only when the batch file is run directly by clicking file name in any folder. Problem comes in the scene when I call this batch file in MS-Access. I used a button on form in MS-Access and used following code on Click event of the button.
Code: [Select]strReportpath = "F:\meter_pictures\"
Shell strReportpath & "Combine.bat"but it not working.
Is any one have an idea what mistake I'm doing?

5617.

Solve : Batch file to convert MarkShulze winds txt to CSV file in right format?

Answer»

Hi.
I searched the forum and found some anwers that allmost helped me, but not enough, because of my missing programming skillz. So i hope that some of u guys&girls can help me out.

I need to convert this txt file containing this

Wind forecast from NOAA RAP
Lat Lon Time
45.322-75.8882000Z
QNH hPaQFE hPa
1017.51002.2
Alt DirSpdTemp
ftAGL degktsdegC
0102 4 8
1000134 9 7
2000213 23 12
3000241 28 13
4000254 30 12
5000263 33 12
6000264 37 12
7000260 40 11
8000256 43 8
9000253 46 6
10000252 47 4
11000253 48 2

into a CSV looking like this

;Altitude(feet), Direction(degrees), Speed(knots)
0,120,4
1000,134,09
2000,213,23
3000,241,28
4000,254,30
5000,263,33
6000,264,37
7000,260,40
8000,256,43
9000,253,46
10000,252,47
11000,252,48

So the top 7 lines are replaced with 1 line.
And the last colum showing temperature is REMOVED. (if possible)

Can any1 help solving this, in a batch file ?Your wanted output doesn't match the input values, but, however...

Process.bat:

@echo off
echo ;Altitude(feet), Direction(degrees), Speed(knots) > output.csv
for /f "skip=7 tokens=1,2,3" %%A in (input.txt) do echo %%A,%%B,%%C >> output.cs
v

Example of usage, showing input & output files:

C:\Batch>type input.txt
Wind forecast from NOAA RAP
Lat Lon Time
45.322 -75.888 2000Z
QNH hPa QFE hPa
1017.5 1002.2
Alt Dir Spd Temp
ftAGL deg kts degC
0 102 4 8
1000 134 9 7
2000 213 23 12
3000 241 28 13
4000 254 30 12
5000 263 33 12
6000 264 37 12
7000 260 40 11
8000 256 43 8
9000 253 46 6
10000 252 47 4
11000 253 48 2

C:\Batch>process.bat
C:\Batch>type output.csv
;Altitude(feet), Direction(degrees), Speed(knots)
0,102,4
1000,134,9
2000,213,23
3000,241,28
4000,254,30
5000,263,33
6000,264,37
7000,260,40
8000,256,43
9000,253,46
10000,252,47
11000,253,48
What!! I was making way longer scritps to make this happen and you come up with something as short and beautiful as this.

Tx man! Works like a charm.You can get it into just 1 line:

Batch script line:

@echo ;Altitude(feet), Direction(degrees), Speed(knots) > output.csv & for /f "skip=7 tokens=1,2,3" %%A in (input.txt) do @echo %%A,%%B,%%C >> output.csv


If you wanted to paste it into a console window, change all of the double percents to single percents:

Console command:

@echo ;Altitude(feet), Direction(degrees), Speed(knots) > output.csv & for /f "skip=7 tokens=1,2,3" %A in (input.txt) do @echo %A,%B,%C >> output.csv

The batch script as written is a bit limited; it only works with an input file called "input.txt" and it only produces an output file called "output.txt". This version requires an input file name as a parameter and emits an output file with the input name with a .csv extension, like so NOA1172xvy.txt ---> NOA1172xvy.csv

Process3.bat:

@echo ;Altitude(feet), Direction(degrees), Speed(knots) > "%~n1.csv" & for /f "skip=7 tokens=1,2,3" %%A in ('type "%~1"') do @echo %%A,%%B,%%C >> "%~n1.csv"

Works with spaces in input filename if you use quotes

C:\Batch>type "ABC NOA1172xvy.txt"
Wind forecast from NOAA RAP
Lat Lon Time
45.322 -75.888 2000Z
QNH hPa QFE hPa
1017.5 1002.2
Alt Dir Spd Temp
ftAGL deg kts degC
0 102 4 8
1000 134 9 7
2000 213 23 12
3000 241 28 13
4000 254 30 12
5000 263 33 12
6000 264 37 12
7000 260 40 11
8000 256 43 8
9000 253 46 6
10000 252 47 4
11000 253 48 2

C:\Batch\>process3.bat "ABC NOA1172xvy.txt"
C:\Batch\>type "ABC NOA1172xvy.csv"
;Altitude(feet), Direction(degrees), Speed(knots)
0,102,4
1000,134,9
2000,213,23
3000,241,28
4000,254,30
5000,263,33
6000,264,37
7000,260,40
8000,256,43
9000,253,46
10000,252,47
11000,253,48
hahau read my mind - tx. I was just playing AROUND with it to do exatly that.
Hm becausefile name is

winds_45.28,-75.91_1200Z.txt

it will only put in
;Altitude(feet), Direction(degrees), Speed(knots)

into the file. If I rename the file it works.. Whats the issue?Use quotes for filenames with spaces or other troublesome characters like dots or COMMAS. In fact you can always use quotes to be safe.

No quotes around input file name:

C:\Batch>process3.bat winds_45.28,-75.91_1200Z.txt
The system cannot find the file specified.

A file called "winds45.csv" (shortened name!) was created with just the first line, like you showed.

Using quotes around input file name:

C:\Batch\>process3.bat "winds_45.28,-75.91_1200Z.txt"
C:\Batch>

This time, the batch completed. Show output file:

C:\Batch>type "winds_45.28,-75.91_1200Z.csv"
;Altitude(feet), Direction(degrees), Speed(knots)
0,102,4
1000,134,9
2000,213,23
3000,241,28
4000,254,30
5000,263,33
6000,264,37
7000,260,40
8000,256,43
9000,253,46
10000,252,47
11000,253,48

Quote from: Salmon Trout on October 09, 2018, 09:39:26 AM

A file called "winds45.csv" (shortened name!) was created with just the first line, like you showed.
In fact, the one-line file with the shortened name was called winds_45.csv with an UNDERSCORE like you'd EXPECT.
5618.

Solve : Batch file to determine free space?

Answer»

I'd like to create a batch file that completes a DIR command and copies this into a text file like this...

DIR > Test.txt

Then I'd like to strip all the information out of the text file except for the last line where it shows bytes free. I want only the number in that last line.
I'd like for the bytes free number to be set as a variable and then use the set command to divide this number by 1073742268 to return the free space in GB to yet another variable.

There may be an easier way to do this without sending this to an actual text file but I've tried different methods out there and none of them WORK when trying to determine the free space inside a TrueCrypt volume. I can do this already via WMIC on my C drive, D drive, etc. but not on my G drive which is a TrueCrypt volume. I can however run a DIR on G which returns the output you would expect.

My goal in sending this to a text file and stripping out the unnecessary strings would not only solve my current need to determine free space within my TrueCrypt volume but it would also help me learn how to strip text files of unnecessary text which I could use in other situations.

Thanks.You can filter out the 'bytes free' line of DIR output using FIND

dir | find "bytes free"

You can parse that line using FOR with the /F switch and separate the 3rd space-delimited TOKEN (which is the number of bytes free) and assign it to a variable. In the FOR dataset you need to escape the pipe symbol with a caret

for /f "tokens=1-3 delims= " %%A in ('dir ^| find "bytes free"') do set bytesfree=%%C

You now have the bytes free held in the variable %bytesfree% BUT you cannot use SET /A to divide it if the bytes free amount to 2 GB or more because batch arithmetic is limited to 32 bits of precision (i.e integers between -2,147,483,647 and + 2,147,483,647)

However you can use the Visual Basic SCRIPT EVAL() function which is not limited in this way. You can create a simple one-line VBScript, pass the calculation to it and use FOR /F to parse the results.

Wscript.echo eval(WScript.Arguments(0))

You may find a large number of digits after the decimal point like so...

21.4063174422784

so you can use another VBScript oneliner to format the number, adding a leading zero if required (for numbers less than 1 GB) and parse the output with FOR /F again

Putting it all together....

@echo off
Set Drive=D:
for /f "tokens=1-3 delims= " %%A in ('dir %Drive% ^| find "bytes free"') do set bytesfree=%%C
echo Wscript.echo eval(WScript.Arguments(0)) > Calculate.vbs
for /f "delims=" %%A in ('cscript //nologo calculate.vbs %bytesfree%/1073742268') do set GBfreeRaw=%%A
REM How many digits after the decimal point
set decimals=2
REM If you don't want a leading zero if GB < 1 then change this to False
Set LeadingZero=True
echo Wscript.echo Formatnumber(WScript.Arguments(0), %decimals%, %LeadingZero%) > Nformat.vbs
for /f "delims=" %%A in ('cscript //nologo NFormat.vbs %GBfreeRaw%') do set GBfreeFormatted=%%A
echo %Drive% GB free: %GBfreeFormatted%

Example output

D: GB free: 128.34










Don't forget to clean up your .vbs scrips after Salmon Trout's code with
Code: [Select]del Nformat.vbs
del Calculate.vbs

Otherwise you end up with .vbs files floating around in your folders which could CAUSE errors in future scripts.Tidied up; pass the drive letter as a parameter; cleans up after itself; only one vbs; uses temp folder for vbs; right-justifies output.

@echo off
for /f "tokens=1-3 delims= " %%A in ('dir %1: ^| find "bytes free"') do set bytesfree=%%C
echo Wscript.echo Formatnumber(eval(WScript.Arguments(0)/1073742268), 2, True,, False) > "%temp%\Calculate.vbs"
for /f "delims=" %%A in ('cscript //nologo "%temp%\Calculate.vbs" %bytesfree%') do set GBfree=%%A & del "%temp%\Calculate.vbs"
set "GBFree= %GBFRee%"
set GBFree=%GBFRee:~-12%
echo %1 %GBfree% GB free

example

C:\>for %A in (A B 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:\ bytesfree.bat %A
A 3.54 GB free
C 21.43 GB free
D 128.34 GB free
F 182.86 GB free
H 206.28 GB free
I 348.84 GB free
V 1388.91 GB free
W 5.99 GB free
To make this work in windows 10 you have to add these lines to the script to take the commas out of the bytes free number returned by the dir find command
add these lines after the line "for /f "tokens=1-3 delims= " %%A in ('dir %Drive% ^| find "bytes free"') do set bytesfree=%%C"

set bf=%bytesfree:,=%
set bytesfree=%bf%


They haven't been back in 5 years...Did you see my Post above yours ? ?

5619.

Solve : Need help - converting the files reading the content from a flat file?

Answer»

Need help in converting the files reading the content from a flat file in a batch. New to the batch. Please see.

Source folder would be having all the reports.
xpdf would be containing pdftotxt.exe which would convert pdf to text file.
Dest folder would be having the converted content.
daily_report.txt would contain the pdf files which need to be converted.

While source would be SEARCHED, it would pick all the files mentioned in the daily_report.txt with today's date, convert it and move it to the destination folder. So in the destination folder, there would not be the date part. It would be same in the flat file.txt.

The files would be looked UPON for 2 hours in every 5 mins till all the files are found or the time is reached. If not found, it would be written to the error log.
Please note: there are few spaces in the file name.

Source:

XXXX_QRRPS Tran book - 0utgoing-en-in_2018-02-09T024757245Z.pdf
XXXX_QRRPS Tran book - Incoming-en-in_2018-02-09T024757245Z.pdf
XXXX_CB Vol By rce-en-in_2018-02-09T024757245Z.xlsx
XXXX_ABC_Rec_Eng-en-eu_2018-02-09T024757245Z.pdf
XXXX_ABC_Rec_Eng-en-eu_2018-02-09T024757245Z.xlsx
XXXX_QRRPS Tran book - Incoming-en-in_2018-02-08T024757245Z.pdf
XXXX_QRRPS Tran book - Incoming-en-in_2018-02-08T024757245Z.pdf
XXXX_CB Vol By rce-en-in_2018-02-08T024757245Z.xlsx
XXXX_ABC_Rec_Eng-en-eu_2018-02-08T024757245Z.pdf
XXXX_ABC_Rec_Eng-en-eu_2018-02-08T024757245Z.xlsx

daily_report.txt would be having
XXXX_QRRPS Tran book - 0utgoing-en-in.pdf
XXXX_ABC_Rec_Eng-en-eu.pdf

dest folder would be having
XXXX_QRRPS Tran book - 0utgoing-en-in.txt
XXXX_ABC_Rec_Eng-en-eu.txtWhy don't you at LEAST attempt a solution considering all the help you have already GOTTEN on DosTips.com

5620.

Solve : batch file to delete before character and after certain character?

Answer»

Quote from: Squashman on February 21, 2018, 11:49:47 AM

Any way you COULD provide a better real world EXAMPLE. I am having a hard time understanding the format of the file itself.
... me too

ironsurface17,
Can you explain why this is IMPORTANT?
An explanation wold make the idea clear and would motivate others to help.
Sometimes explaining a TASK reveals a detail that was overlooked.
5621.

Solve : Is possible to install MS-DOS to GPT disk??

Answer»

Hi!

I need to use GPT disk instead MBR.
I want to have there installed MS-DOS 7.10.

Is possible to install this MS-DOS to GPT disk?
Or will installation work after conversion from MBR to GPT disk work?

I don't need and want not use UEFI. It will boot from BIOS... so, here's ALSO Q if will XP work on GPT disk...

Thank you for your help.
MiroQuote from: MIRKOSOFT on September 20, 2018, 04:32:22 AM

Is possible to install this MS-DOS to GPT disk?
No.

Quote
I don't need and want not use UEFI. It will boot from BIOS... so, here's also Q if will XP work on GPT disk...
Drives PARTITIONED VIA GPT can only be BOOTED via a UEFI BIOS and the OPERATING systems have to support UEFI.
Ok - so it is not possible override...

Thank you, we can close this thread.
Miro
5622.

Solve : Strange issue with DOS games?

Answer»

You have more than 1 sound card installed ? ?...that may be the issue right there...remove all but the 1 that works best...

OLDER ver. of Windows /DOS get confused easily...Quote from: PATIO on September 06, 2018, 04:17:41 PM

You have more than 1 sound card installed ? ?...that may be the issue right there...remove all but the 1 that works best...

Older ver. of Windows /DOS get confused easily...
patio,

If I decide to remove a sound card, it will be the AWE64. The Live! is not being uninstalled as I only use it for Windows-based games. The Sound Blaster Live! stays disabled in the Device MANAGER unless I need to use it. The AWE64 is also disabled in the Device Manager right now. (I only enable one at a time.) Also, I am having the 16 Value and the AWE64 use different I/O and IRQ settings. If the settings conflict, there will be no sound. The 16 Value is using I/O 220 and IRQ 7, and the AWE64 is using I/O 240 and IRQ 5. Both are using DMA 1 right now, but I could make the AWE64 use DMA 3. The Live! always uses IRQ 10. If the Live! gives no sound, then the AWE64 will be removed. The Roland SCC-1 is using I/O 330 and IRQ 3, so none of the Sound Blaster cards installed in that computer can use I/O 330 for their MIDI because of this. I always set their MIDI to IRQ 300 but never use it because of the SCC-1 sounding a lot better.Update:

I removed the AWE64 and put it in an anti-static bag. I have the original driver CD, so no need to look for drivers if it goes back in.
5623.

Solve : Verify folders on list of servers?

Answer»

I have 50 servers that I want to verify if the following path exists.

D:\mssql\data
T:\mssql\data
e:\mssql\data

How do I do this. I want to report to me if it exists or not. Thank youAll 50 have these 3 paths?

Assuming you have shares set up to the paths to get to paths through UNC CALLS such as \\ServerName\d$\mssql\data ?

Are they all physical drive LETTERS on the servers? If they are mapped drive letters it will NEVER work because those only exist during a user session.No Shares. I just need to validate if the path has been created or not.
How do I create the script to go through 50 Servers and say WHETHER the path exists or not.

Example:
Server A Data: D:\mssql\data exists
Server A Log: L:\mssql\data exists
Server B Data: D\mssql\data exists
Server B Data: L:\mssql\data existsLess clear now than when you started...

5624.

Solve : Sending the date to clipboard without opening a command window?

Answer»

Hi!

tl/dr:
Can someone please give me a simple Run command snippet that will send the short version of today's date (ex. 09/12/18) to the clipboard without opening any Command PROMPT windows or changing focus? I have spent several hours searching for answers and trying different things, to no avail.

The Run Command I was trying to use is:
Code: [Select]echo %date:~4,6%%date:~12,2% | clip
Context / Details:
I have a macro keyboard (Razer Ornata CHROMA) that allows me to create simple macros and bind them to keys.

The Macro software allows me to use keystrokes, text, mouse clicks, and Run Commands. For example I have a simple Run Command + text macro that opens a browser window, pastes a fogbugz case URL without a case ID, and leaves the cursor at the end of the URL so I can type in the case ID. Yay. I am not a coder, so I just use a simple run command: "firefox URL about:blank"

I'd like to create another basic macro that essentially inserts the date into whatever program/text field has focus, just to save me some typing time.
I successfully created one using a Run command that pipes the %date% variable (or just the output of DATE /T) into the clipboard. Then I try to use a Keystroke to perform Ctrl+V. Should be simple.

However I have 2 issues:
1. My macro opens the cmd prompt window. I don't want a command window popping up every time I use the macro, or I will have 100 by the end of the day.
2. The cmd window takes focus. So instead of pasting my clipboard contents into OneNote or FogBugz or whatever, I just end up with a "v" on the command line of a cmd window.
3. I don't actually know how to use MS-DOS commands, so I'm not sure how to run a command silently / with invisible window. Also, the echo command baffles me.


Thank you for your help!Save the code below as a Visual Basic Script (with a .vbs extension)

Make sure that wscript.exe is the default script engine
Make sure that script engine logo display is disabled.
To do these things open an Administrator command prompt and execute this command (you only need to do it once):

wscript //h:wscript //nologo //s

Code: [Select]Set WshShell = CreateObject("WScript.Shell")
Set oExec = WshShell.Exec("clip")
tnow=now()
dd = day(tnow): if dd < 10 Then dd = "0" & dd
mm = month(tnow): if mm < 10 Then mm = "0" & mm
yyyy = year(tnow)
dstring=mm & "/" & dd & "/" & yyyy
Set oIn = oExec.stdIn
oIn.WriteLine dstring
oIn.Close Use another keyboard macro program.
Try this one:
http://www.download82.com/download/Windows/KeyText
Quote

KeyText screenshotKeyText is a multi-function text and automation tool that is capable of storing boilerplate text, ready to be pasted or typed into any application or document with only a hotkey press, menu selection or trigger text. The program also features a "Right-click anywhere" function which eases form-filling and saves you precious time.

KeyText also integrates commands to change windows, run applications, visit Internet websites, click buttons, and many more. in addition, the application enables you to automate mouse clicks that hit the right area in cases when a window changes its position.

The "Smart Select" function allows you to easily select text in any application and trigger various actions (go to an ONLINE map, website, dictionary, e-mail, etc) according to the type of the selected text (URL, E-mail address, Zip Code, etc).

KeyText integrates powerful and advanced features such as regular expressions which let you handle and examine text in a sophisticated and efficient manner. The built-in scheduler lets you set times and days for running various programs or monitor for SPECIFIC dialogs, windows, password requests and automatically fill them with only one click.
Pros
The documentation is rather large. Sorry, I can't help you with that. I use it to do do this:
Thursday, September 13, 2018
The above line was entered when I held the alt key and hit F6.
You will have to download and install the program end read the documentation. Sorry I can not help you with the details. ECHO is an internal command that is built-in to cmd.exe. If you are trying to execute that from the run BOX you would need to use cmd.exe with the /C option.You can bind a keystroke to a macro in Windows.
https://support.microsoft.com/en-us/help/237179/assign-macro-or-function-to-keys-on-your-keyboard
Quote
This article describes how to change or assign a command, a macro, or a program to a keyboard shortcut on the Microsoft Keyboard.

That might be of some help, but it is beyond my understanding.
5625.

Solve : how to loop files in a folder which has space in it?

Answer»

Hi
I have the following CODE to copy files from a list. When the path of the files which the folder NAME has no space, it works perfectly. But the folder names could have space sometimes, how can I improve the code to handle the folder name with space

FOR /F %%a in (find_file_list.txt) DO COPY "%%a" "C:\test\%%~nxa"

BASICALLY, in this find_file_list.txt, there list all files with path

c:\abc\def\12345.txt
c:\abc\def\12346.txt
c:\abc\def\12347.txt

the above code copy all these three files into folder of test and works fine.
Now when find_file_list.txt change, actually the REAL folder name has space in it, like

c:\ab c\de f\12345.txt
c:\ab c\de f\12346.txt
c:\ab c\de f\12347.txt

the above code not working anymore...
any thoughts?
Thanls
Pretty sure you have been shown how to properly read a file in several of your questions on other forums. Not sure how you keep forgetting to do THINGS.

5626.

Solve : Track Ball?

Answer»

Hi all! I have a Compaq LTE 4/25 laptop and am looking for a drivers from the integral TRACKBALL to use it as a mouse for dos games. Any suggestions?

Thanks!!!UNLESS a DOS driver was ever created for it in the past which has gone missing due to its age, its very likely that the driver was only ever made for Windows 3.x and maybe 95. I dont know of any wrapper program to get Windows drivers to work within DOS only. You might be forced to construct your own drivers.

During the period that that laptop was made controls in DOS were mainly Joystick or Gamepad through Game Port https://en.wikipedia.org/wiki/Game_port

One option might be to find a Mouse or Track Ball that is EXTERNAL to laptop that connects through 9-pin serial that has DOS Drivers for it readily available.

In my travels through that time period there were very few applications that ran DOS only environment that gave Mouse/Track Ball functionality. Almost all DOS software was keyboard driven controls.

If you have Windows on it running and run the program while Windows is running and you have drivers for the track ball for Windows working, you might be able to run a program in DOS that has mouse/track ball control options and have Windows translate the controls to the DOS environment but I am thinking that sort of stuff with Windows/DOS co-existent functionality for the Mouse/Track Ball didnt happen until 95 or 98, and prior controls were strictly devices intended for DOS only environment support. Additionally games or software in DOS that had control options other than keyboard controls usually required manual configuration of non-plug-n-play settings where your telling it everything it needs to function as was sound cards that I had that had the Game Port option, as well as if it was a 9-pin serial device there was a serial configuration for it such as which com port the device is at and all that because there was no auto sensing like USB unless a DOS program checked for device handshake at COM1 and then COM 2 and all the way through say COM 4 and then time out with no device found if a handshake to device not found which I can see being made possible but never seen a software that did that that was DOS only.MOUSE.COM should be in the DOS installation directory. You can run it either manually or add it to autoexec.bat, but it should detect and allow MS-DOS Applications that support the Mouse to use it. Integrated Mice are typically connected internally either via Serial or PS/2. (probably the latter for the 4/25).

If you cannot find a MOUSE.COM to use, you can find it online. here is one source with a number of alternatives and different versions of various DOS Mouse Drivers. Cutemouse and the Microsoft Mouse Driver(s) are good starting points.

Thank you very much for the awesome responses I THINK I may have a overspoken myself. I got windows 3.1 to run but I need a driver for the trackball that is integrated with the laptop can any HELP with that thank you 🙏 😀The suggestions are above ^^^

5627.

Solve : Rename only a single file at random in a target directory to 1.MP4?

Answer»

Trying to find a way to rename only a single file at random from a target directory to 1.MP4 so that my shortcut on my desktop points to same file name but the movie played is at random each time the batch is run.

Tried a few different methods from stuff I found online, but ran into issues with them.

This one here I was thinking about using to rewrite it into a single file targeted with a TEST file storing its original name so that files can TAKE on their original name when batch is run a second time. https://www.howtogeek.com/57661/stupid-geek-tricks-randomly-rename-every-file-in-a-directory/ but this one renames all in the target directory with a random number name.

Was thinking that the best method would be one that selects a file from DIR output at random and then saves the original file name and then renames that file to 1.MP4 and then this way the shortcut at the desktop points to a random movie file and each time the batch is run the original name is written back to the last file that was named 1.MP4 and another file at random taken and renamed as 1.MP4 in the target location. However at a loss on how to get the random selection of a file name from DIR output or maybe there is a better method to use to achieve this other than a random generator that the number output maximum random value is equal to file count from DIR and some other means of selecting a file at random to be renamed as 1.MP4

Geek-9PM's MP3 prepend project had me thinking about a random selection for movies and that a movie of a static name that a shortcut name doesnt change but the file itself can change its contents as a means of random movie viewing from a shortcut on desktop.

Earlier tonight I gutted the batch from the link above to rename all files in a target to number names, but that creates all sorts of problems such as if the random generator chose the same number more than once before the batch ends iterations, then files can be deleted by 2 files give the same name where the last rename overwrites the prior file contents.

Other issue I ran into was setting the min-max random values the min/max parameters were writing to the name when when setting the random min max to a variable and then calling to variable as !number! A few things... surely better to copy (rather than rename) a file to 1.mp4 ... ? That way, each time you go round the cycle again, you are only deleting a copy, and all your files are unchanged. COOL! I like that idea. A file can be chosen at random from one directory and place into a different location then that copy renamed.

Definitely a much safer approach to this. And it would make the batch way easier not having to retain the original file name in a text file to rename that file back to its original name before adding a new file name to that text file and then renaming that file to 1.MP4

Been searching around for how to parse a DIR output and chose a file name at random from that. I was thinking that the file count can be used to set the random max value so if there was 184 files the random max would be 184 and if movies are added or deleted it can maintain to the scope of the actual file count for that directory and set the random max to that file count.

Here below is what i was messing around with last night that I tombstoned because its too dangerous and if more than one file is given the same random number file name it could destroy files.

WARNING: Anyone checking out this batch, dont run it unless you know what your doing, it will rename all files within the target directory where it is run to random number file names.

I was originally going to use this with setting min/max random scope and ifexist for 1.mp4 testing so that if a file with random number of 1 is not generated, run again until a file is renamed as 1.MP4... BUT that is too dangerous and I like the safer approach of selecting a file at random from one directory to be placed into another and then the copy renamed as 1.MP4

Code: [Select]@ECHO OFF


SETLOCAL EnableExtensions EnableDelayedExpansion


FOR /F "tokens=*" %%A IN ('DIR /A:-D /B') DO (
IF NOT %%A==%~nx0 (

SET FileExtension=%%~xA

REM concatonate new random name with prior filename's file extension
SET NewName=!RANDOM!!FileExtension!

REM Display to user
ECHO %%A/!NewName!

REM Rename with newname
RENAME "%%A" "!NewName!"


)
)
pauseThis should work... there seems to be a bug in the batch random number generator, where if you start a batch by double clicking it in Explorer, you always get the same "random" number, so I use a vbs helper script. None of the echo statements are essential except the one I draw attention to below, and the final PAUSE is not essential either.

@echo off
setlocal enabledelayedexpansion

REM don't delete this echo line unless you ALREADY have rando.vbs in the folder
echo randomize:wscript.echo int(((wscript.arguments(0)-1+1)*Rnd+1)) > rando.vbs

if exist 1.mp4 del 1.mp4
set nfiles=0
REM cycle through mp4 files in this folder
REM (1) to count them
for %%A in (*.mp4) do (
echo [!nfiles!] %%A
set /a nfiles+=1
)
echo There are %nfiles% mp4 files in this folder
set minval=1
set MAXVAL=%nfiles%
echo choose random number between 1 and %nfiles%
for /f "delims=" %%R in ('cscript rando.vbs %nfiles%') do set randnum=%%R
echo Chose random number: %randnum%
REM cycle through mp4 files in this folder
REM (2) to select file to copy
set tfile=0
for %%A in (*.mp4) do (
set /a tfile+=1
if "!tfile!"=="%randnum%" (
echo copy "%%A" -^> 1.mp4
copy "%%A" 1.mp4
)
)
pause
A quick modification... your system's cscript.exe may be in default mode, that is showing a logo so to make sure this does not cause problems, make this change

Code: [Select]for /f "delims=" %%R in ('cscript //nologo rando.vbs %nfiles%') do set randnum=%%R
cscript behaviour if logo is showing:

Code: [Select]E:\randmp4>cscript rando.vbs 10
Microsoft (R) Windows Script Host Version 5.812
Copyright (C) Microsoft Corporation. All rights reserved.

2
cscript behaviour if logo is NOT showing:

Code: [Select]E:\randmp4>cscript //nologo rando.vbs 10
8
set nologo permanently (logo never shows unless you use cscript //logo)

Code: [Select]E:\randmp4>cscript //nologo //s
Command line options are saved.
set logo show permanently (logo always shows unless you use cscript //nologo)

Code: [Select]E:\randmp4>cscript //logo //s
Microsoft (R) Windows Script Host Version 5.812
Copyright (C) Microsoft Corporation. All rights reserved.

Command line options are saved.Of course, when I say show/unshow logo 'permanently', I mean 'until you change the option'.Hello Salmon... Thank You for this solution!

Testing it out now and gonna relax to a random movie before bed.


Update: So it works if for /f "delims=" %%R in ('cscript rando.vbs %nfiles%') do set randnum=%%R is used, but if I replace that line with for /f "delims=" %%R in ('cscript //nologo rando.vbs %nfiles%') do set randnum=%%R it doesnt create the 1.MP4 file copy

I guess it doesnt like the //nologo, so I'm running it with the line of for /f "delims=" %%R in ('cscript rando.vbs %nfiles%') do set randnum=%%R

Initially when it didnt create the 1.MP4 I was thinking that spaces in the file name may be to blame, but looking in the batch its encased in " " so it should be immune to spaces in file names. Then decided to try it without the //nologo and then it worked.

System is Windows 10 64-bit if that matters at all.

Now to watching the random episode of "My Name is Earl" that it selected from random Thanks Salmon!

5628.

Solve : Screen resolution change in command line / DOS?

Answer»

Hi!

I need to adjust screen resolution in MS-DOS by batch or command.
I know any changes are POSSIBLE, but at what level?

The same can be useful in modern Windows... by command line or batch file.
Even maybe in multi monitor systems.

Is it possible?

Thank you for each suggestion or help.
MiroWhy DOS / ?Understand not Q...

No matter why, but how?

MiroFor MS-DOS, the mode command is probably the best you'll find. You can use mode CON:lines=50 for example to change from 25 lines to 50 lines on-screen.

MS-DOS itself operates in TEXT mode, so the actual screen resolution itself is largely measured in characters like this.

Mind you, I recall, ages ago, on my 386 that my Trident Video CARD's drivers included a utility that could crank up the number of lines up to 100 and somehow had MS-DOS itself working through a graphics mode, but I don't know the details of that.

For Windows you could use a utility like multires. Or WRITE your own program to call from the batch file which changes the resolution.

5629.

Solve : Batch job to scample order of music files.?

Answer»

I have a lot pf MP3 files I want to put on a SB. About 50 files
The cheap MP3 player I have can play the songs. Put I want the order to be broken.
This little player has no way to scramble the order.

So, is there a way I can use a batch FILE to put a prefix on each file name ?
The files are now in a directory on my PC.
Of course Windows puts them in alpha order.
So when I copy them to the SD card they end up in that order.
But I do not want them in order.

Do you understand what I want?
Quote

Of course Windows puts them in alpha order.
Windows does not 'put' files in any particular order. It MUST be your player. So a RANDOM alpha prefix might work? Like this?

Apple.mp3 -> pqz_Apple.mp3
Bear.mp3 -> svt_Bear.mp3
Cauliflower.mp3 -> lxn_Cauliflower.mp3

Is that something like what you want?

Copy blue text below into Notepad and save as a .bat into folder where you want shuffled names to go. The folder for shuffled files MUST EXIST. You can hopefully see where to make changes to customize. Existing files not changed; new copies created in another folder.

@echo off
setlocal enabledelayedexpansion

REM where to put shuffled files
SET shuffledfolder=shuffled

REM length of random letter string
set stringlen=3

REM ASCII values reminder
rem A = 65
rem X = 90
rem a = 97
rem z = 122

REM choose case of prefix letters
REM set to either UPPER or lower
REM case of variable name doesn't matter!
set case=UPPER

REM assign max & min values for random number

REM UPPER CASE
IF /i "%case%"=="UPPER" (
set minval=65
set maxval=90
)

REM LOWER CASE
IF /i "%case%"=="lower" (
set minval=97
set maxval=122
)

echo START PROCESSING FILES
for %%A in (*.mp3) do (
call :makestring
echo %%A ---^> %shuffledfolder%\!rstring!_%%A
copy "%%A" "%shuffledfolder%\!rstring!_%%A"
)
echo FINISHED PROCESSING FILES
pause
exit /b

REM *** SUBROUTINE START
:makestring
REM create empty string
set "rstring="

REM set letter count to zero
set chars=0

REM loop back to here until desired
REM length is generated
:genloop

REM choose a random number between minval and maxval
set /a "ascii=%RANDOM% * (%maxval% - %minval% + 1) / 32768 + %minval%"

REM set errorlevel to that number
cmd /C exit /b %ascii%

REM get letter corresponding to that exit code
set letter=%=ExitCodeAscii%

REM add that letter to end of string
set rstring=%rstring%%letter%

REM increase letter count by ONE
set /a chars+=1

REM if letter count less than desired length
REM then loop again
if %chars% LSS %stringlen% goto genloop

goto :eof
REM *** SUBROUTINE END

(1) Input files

Drive My Car.mp3
Girl.mp3
If I Needed Someone.mp3
I'm Looking Through You.mp3
In My Life.mp3
Michelle.mp3
Norwegian Wood.mp3
Nowhere Man.mp3
Run for Your Life.mp3
The Word.mp3
Think for Yourself.mp3
Wait.mp3
What Goes On.mp3
You Won't See Me.mp3

(2) Output of script

START PROCESSING FILES
Drive My Car.mp3 ---> shuffled\JDZ_Drive My Car.mp3
1 file(s) copied.
Girl.mp3 ---> shuffled\OTC_Girl.mp3
1 file(s) copied.
I'm Looking Through You.mp3 ---> shuffled\ZBJ_I'm Looking Through You.mp3
1 file(s) copied.
If I Needed Someone.mp3 ---> shuffled\SRG_If I Needed Someone.mp3
1 file(s) copied.
In My Life.mp3 ---> shuffled\WFP_In My Life.mp3
1 file(s) copied.
Michelle.mp3 ---> shuffled\WSH_Michelle.mp3
1 file(s) copied.
Norwegian Wood.mp3 ---> shuffled\DEA_Norwegian Wood.mp3
1 file(s) copied.
Nowhere Man.mp3 ---> shuffled\WYY_Nowhere Man.mp3
1 file(s) copied.
Run for Your Life.mp3 ---> shuffled\YAU_Run for Your Life.mp3
1 file(s) copied.
The Word.mp3 ---> shuffled\BQL_The Word.mp3
1 file(s) copied.
Think for Yourself.mp3 ---> shuffled\QDL_Think for Yourself.mp3
1 file(s) copied.
Wait.mp3 ---> shuffled\RZD_Wait.mp3
1 file(s) copied.
What Goes On.mp3 ---> shuffled\PHE_What Goes On.mp3
1 file(s) copied.
You Won't See Me.mp3 ---> shuffled\TZP_You Won't See Me.mp3
1 file(s) copied.
FINISHED PROCESSING FILES
Press any key to continue . . .

(3) Result in shuffled folder:

BQL_The Word.mp3
DEA_Norwegian Wood.mp3
JDZ_Drive My Car.mp3
OTC_Girl.mp3
PHE_What Goes On.mp3
QDL_Think for Yourself.mp3
RZD_Wait.mp3
SRG_If I Needed Someone.mp3
TZP_You Won't See Me.mp3
WFP_In My Life.mp3
WSH_Michelle.mp3
WYY_Nowhere Man.mp3
YAU_Run for Your Life.mp3
ZBJ_I'm Looking Through You.mp3


Same script minus comments and blank lines

@echo off
setlocal enabledelayedexpansion
set shuffledfolder=shuffled
set stringlen=3
set case=UPPER
IF /i "%case%"=="UPPER" (
set minval=65
set maxval=90
)
IF /i "%case%"=="lower" (
set minval=97
set maxval=122
)
echo START PROCESSING FILES
for %%A in (*.mp3) do (
call :makestring
echo %%A ---^> %shuffledfolder%\!rstring!_%%A
copy "%%A" "%shuffledfolder%\!rstring!_%%A"
)
echo FINISHED PROCESSING FILES
pause
exit /b
:makestring
set "rstring="
set chars=0
:genloop
set /a "ascii=%RANDOM% * (%maxval% - %minval% + 1) / 32768 + %minval%"
cmd /c exit /b %ascii%
set letter=%=ExitCodeAscii%
set rstring=%rstring%%letter%
set /a chars+=1
if %chars% LSS %stringlen% goto genloop
goto :eofThank you.
That will be fun to test. Later today...
Just tried it on a group of small MP3 files.
I tested just then tracks to see what would happen. After I got the folder relations right, it worked perfectly. That BAT has to be inside the MP3 folder and the snuffled folder has to be there also.

It did a nice job of putting tracks in a scramble order.
The new order is:
6 5 10 8 7 9 1 2 4 3

Salmon trout, you are amazing!
Of course you can make the folder, where the shuffled files go, anywhere you like. See the line in red below.

@echo off
setlocal enabledelayedexpansion
set shuffledfolder=c:\some\folder\whatever
set stringlen=3
set case=UPPER
IF /i "%case%"=="UPPER" (
set minval=65
set maxval=90
)
IF /i "%case%"=="lower" (
set minval=97
set maxval=122
)
echo START PROCESSING FILES
for %%A in (*.mp3) do (
call :makestring
echo %%A ---^> %shuffledfolder%\!rstring!_%%A
copy "%%A" "%shuffledfolder%\!rstring!_%%A"
)
echo FINISHED PROCESSING FILES
pause
exit /b
:makestring
set "rstring="
set chars=0
:genloop
set /a "ascii=%RANDOM% * (%maxval% - %minval% + 1) / 32768 + %minval%"
cmd /c exit /b %ascii%
set letter=%=ExitCodeAscii%
set rstring=%rstring%%letter%
set /a chars+=1
if %chars% LSS %stringlen% goto genloop
goto :eof
Right.
It was easy to just make a new folder. After the job was done, I copied the shuffled stuff to the memory card of the MP3 player.

Sot I will note that for future reference, I could have just mdse the MP3 player the target using a USB cable.
5630.

Solve : hELP Cannot find OS?

Answer»

I have installed MSdos 71 on my old HP Vectra 386 but I cant get it to boot up. After bios its says 'Cannot FIND operating system' then it hangs. There is no other OS on this system. When I use a startup floppy for WIN 98 to get to dos prompt and I type autoexec, then MSdos starts up. I have done the sys c: and it was a success, I even tried tinkering with MSDos.sys file but after several fdisk /mbr, rebuilding mbr etc, I am still not able to boot from C: hard drive.

Any help is appreciated.Where is this copy of DOS from ? ?...sys C:\ has to be done PRIOR to the install not after...The Win98 floppy ain't gettin you into the installed DOS...its simply gettin you to command off the floppy.

Start over...MS-DOS 7.1 is a non-official (pirated) release of MS-DOS that is ripped out of Windows 98 OSR-B or Windows 98. The setup program lies and says it is under GNU GPL. It's not. It also gives a good impression that it is an official product. Again- it's not.

Try to get a "real" version of MS-DOS and see if you have better luck.+ 1...Ok guys, thanks for your response, I did not know that MSdos 7 was not genuine, I will GO and try 6 or Freedos though I was hoping to keep it MS not knowing that its not all that glitters is gold.Hello guys, I have installed Freedos and still cannot get a bootable hard drive, the message now is read error while reading drive.

ThanksThen the HDD is failingQuote from: patio on July 06, 2018, 10:06:38 PM

Then the HDD is failing

Thanks Patio, by mentioning the HD, u remind me of info that I forgot to mention here which is, Im using an 8gig SSD and its brand new. Does it make any difference? I dont have a spare dynamic drive I can try out to see if it does. Ok after 1 week of tinkering, I installed Dos 6.22, transferred the system files and wallah, I GOT a bootable hard disk. One thing I discovered from all my experience which I think might be useful for some readers on here is that, most of the current Dos software out there that have been written in the last 5 to 10 years like Freedos, mbr utilities etc, are actually written with Linux. Not all Bios can read Linux. When u stick in a bootable floppy that is coded in Linux, it wont boot, u will see a few dots on the screen then it will hang. I also noticed that if u used any of these so called Dos utilities that are code with Linux to fdisk or format ur drive on such a old computer, earlier fdisk will not be able to read such drive. Not true at all if the boot stik is built proper...Quote from: modobo on July 09, 2018, 08:00:06 PM
most of the current Dos software out there that have been written in the last 5 to 10 years like Freedos, mbr utilities etc, are actually written with Linux. Not all Bios can read Linux. When u stick in a bootable floppy that is coded in Linux, it wont boot, u will see a few dots on the screen then it will hang. I also noticed that if u used any of these so called Dos utilities that are code with Linux to fdisk or format ur drive on such a old computer, earlier fdisk will not be able to read such drive.

What you are describing is when something is Linux, not whether something is "coded in" Linux. A lot of utilities are based on the Linux Kernel. (memtest for example). And Kernel version 3.8 dropped support for the 386; it has nothing to do with the "BIOS not reading Linux"- instead the kernel is hanging/crashing during the boot process itself.
5631.

Solve : Dos open exe -- fonts incorrect?

Answer»

Just TESTING an old bank exe program
It can DISPLAY correctly in VDos but not Dos in Windows. HOWEVER, VDos / DosBox both cannot read/ write my HARD disk after running the exe.
checked codepage is both set in 437
Any ideas?

MANY Thanks!

Sorry for my bad english.Do you have written consent from the bank to use that? Even if old, licenses and regulations don't change.Quote from: DaveLembke on July 11, 2018, 10:22:49 PM

Do you have written consent from the bank to use that? Even if old, licenses and regulations don't change.
Yes.
It is sent from bank to its customer (our company) for autopay to use legally.
We are going to migrate Windows XP to Windows 7 for running this application.
Although I setup another Windows XP, the same result as capture screen is get.
All the fonts, codepage, screen resolution, Non-Unicode country setting is double checked.
Really no ideas.

The program is trying to use ANSI escape sequences.

Add the line

Code: [Select]Device=ansi.sys in C:\Windows\system32\config.nt If there is no config.nt file, create it. (Note, also try C:\Windows\Syswow64\config.nt)Quote from: BC_Programmer on July 12, 2018, 05:11:30 PM
The program is trying to use ANSI escape sequences.

Add the line

Code: [Select]Device=ansi.sys in C:\Windows\system32\config.nt If there is no config.nt file, create it. (Note, also try C:\Windows\Syswow64\config.nt)

It works!!!
Really really thanks for your help!
5632.

Solve : Is possible to perform boot by command??

Answer»

Hi!

I have two diskettes which I want to boot from.
Installed is MS-DOS 6.22, diskette 1 is MS-DOS 7.10 Super Boot Disk and diskette 2 is CP/M86 1.1.

In case of MSD7.10 is possible to start AUTOEXEC.BAT - but after starting it outputs incorrect DOS version.
In case of CP/M is not possible to do anything 'cause CP/M uses other filesystem.
Both disks have boot-sector written.

My wish is to PERFORM boot from floppy by command - without true reboot.
Is it by any way possible?

Thank you for patience.
MiroI was SEARCHING the web and found NOTHING correct.
Simple example of my Q is in retrocomputing - my hobby:

Commodore 128 came with new BASIC 7.0 with new command: BOOT
At power on or reset it searches for boot sector on diskette.
This process is possible to call by two ways:
1. Call boot procedure in ROM
2. use BOOT COMAND, even with options:
BOOT, drive, UNIT
- drive is for dual floppies (0 or 1)
- unit is number of floppy unit in filesystem (8-30 > similar or DOS/WIN A--Z)

Something similar I need to find.
MiroI'm not aware of any method by which this would be possible with MS-DOS. There are programs that can reboot but they do effectively the same thing as Control-Alt-Delete.

5633.

Solve : Batch game, HP?

Answer» HI! it's been a while since i have been PROGRAMMING in batch now, and i'm trying to get back into it.

BASICALLY, what i'm trying to do is make kind of a Pokemon 1v1 game. I've made the hp of the POKEMONS into two variables, to make it possible to lower the hp after attacks. But the hp wont show? I've searched the web and nothing helps. I'll provide a screenshot of the code and a screenshot of the game:

(Just to clarify, sqhp means Squirtle HP and pkhp means Pikachu HP)

https://gyazo.com/a9b37e7f4e4530f95160548439f5daa1 To zoom in, click on the picture.
https://gyazo.com/950519488872d7afeb3a5dee117bbdd2

I appreciate all the help i can get.You never initialize the HP Variables- You skip over them ENTIRELY with the goto start.Wow, im so dumb haha

Thanks alot I'm curious how far you got with this project. Is it ready for testing?
5634.

Solve : Batch script to rename files based on date modified?

Answer»

Hi folks,

You might remember me from a few months ago. I'm working on a long-term time lapse for a construction project which involves a couple gopros taking pictures every 60 seconds. I posted a question and received an answer about a batch script to delete files based on the (24h) date/time modified in order to delete photos taken at night. I ended up using this script from Salmon Trout which worked perfectly.

Code: [Select]@echo off

> "%temp%\fhour.vbs" echo Set fso = CreateObject("Scripting.FileSystemObject")
>> "%temp%\fhour.vbs" echo Set f = fso.GetFile(trim(wscript.arguments(0)))
>> "%temp%\fhour.vbs" echo wscript.echo Hour (f.DateLastModified)

for %%A in ("H:\*.*") do (
for /f "delims=" %%B in ('cscript /nologo "%temp%\fhour.vbs" "%%~fA"') do (
set "action="
if %%B lss 8 set action=Delete
if %%B geq 18 set action=Delete
if /i not "%%~fA"=="%~f0" if defined action echo deleting "%%~fA" & del "%%~fA"
)
)
pause
This script leaves me with only photos taken during work hours. The next problem I've encountered is that the Gopro studio software creates different video segments based on the chronological order of the file names. Cutting out 60% of the photos causes the software to create a large number of video segments that TEND to have no rhyme or reason to their length or order. I solved this problem with another batch script that renames files to a certain naming convention based on the order they appear in the folder:

Code: [Select]@echo off
pushd %~dp0
setlocal EnableDelayedExpansion

set filename=asdf
set Num=1
for /r %%i in (*.jpg) do (
ren "%%i" "%filename%.!Num!.jpg"
set /a Num+=1
)


I've been adding captions (dates, descriptions, etc) to the video within the gopro software. I've been doing this manually and I'm OK with that (some people out there are using python scripts to pull the metadata from photos and automate their CAPTIONING that way but I'm not prepared to go that deep quite yet). Until now I've been able to simply watch the video, observe when its getting dark, and add captions based on what I see in the video. As the days get longer I'm finding it increasingly difficult to PICK out the transitions from one day to the next and this is only going to get more difficult as the days get longer.

Here is my question:

Is there some way to modify the second script I posted so that it will rename the files based on the date/time modified rather than the order in which the files appear in the folder? Right now the script is renaming the files to "asdf.zzz.jpg" where zzz is just an arbitrary sequential number (num+1). What I'd really like is for it to rename the file to something along the lines of "asdf.wwww.xx.yy.zzz.jpg" where wwww is the year (2018), xx is the MONTH (02), yy is the day (22), and zzz is either the time in 24h format (0800) or an arbitrary sequential number starting at 1 for the day (num+1). I believe either will work.

If I import a large number of photos named with this naming convention the software should automatically create a single video segment per day which will make my captioning and data management infinitely easier.

Any help is greatly appreciated.

JeremyWouldn't a better description of date and time be YYYY.MM.DD.hhmm?Yes, most definitely. I don't know why I defaulted to wwww.xx.yy.zzzz

5635.

Solve : Help with unknown path?

Answer»

Hello everyone!
I need some help here and I'm sure the answer is right in front of my face, I am just missing it.

I want to use this bat file to "release" a project at my work.
Which is basically copying a couple files to a job folder.
Job number is a variable and the only known one.
Job name is always a string of text with spaces and symbols which could cause a problem.
But the name is always irrelevant so I want to get past this by using *
These components are the label of the folder for example (Y:\1121 TEST JOB)
I can verify this path exists with

Code: [Select]if exist "Y:\%jobNumber%*" (
goto success
)
goto fail

Now I need to copy a set of files to DIFFERENT sub folders within that job folder.
This is where the problem comes. I'm actually unzipping these files due to a lack of knowledge on how to properly copy them the way I want to but that doesn't matter, either way you think is best is FINE here.

Code: [Select]set pathStart="%~dp0\job.zip"
set pathEnd="Y:\%jobNumber%*"
"C:\Program Files\Winrar\WinRAR.exe" x %pathStart% *.* %pathEnd%

I realize that my use of the * SYMBOL within the quotes is screwing me here but I've tried this a few ways and no matter what it always unzips to the pathStart which is where the bat is located not where the job folder is.

If you have any suggestion to make this work I would greatly appreciate it!
Thanks -JoshPlease describe the job in more detail. Please do that. Also, please try to answer the following

Quote

Now I need to copy a set of files to different sub folders within that job folder.

What sub folders? Do they exist already? How is the script to know which files go into which sub folders?

Please note that while an asterisk wildcard will find a folder that matches the string* spec, it won't magically read your mind and create folders based on what you want.

Quote
"C:\Program Files\Winrar\WinRAR.exe" x %pathStart% *.* %pathEnd%

What do you think the bit in bold red will do?

From the WinRar help file:

Quote
unpack the archive Info.rar to folder d:\data
WinRAR x Info.rar d:\data\



Here is the full code. (see bottom) I've updated it a bit since I posted this question but I'm still pretty MUCH stuck at the same spot. I've learned a little bit from you already though. Even in another post you were involved in which gave me an idea for this! So thank you!

The sub folders are the same in every job folder and I tell the program the path at the beginning. I planned on just using these as a suffix to the job folder path after the program finds it.

I know the asterisk won't create folders for me. The job folder's name looks something like this.
"1121 Construction Company 165 Apple Rd, New York"
So only the number assigned to the job at the beginning of the folder is a known value for all the workers who would use this.

I have no idea what the bit in red does lol. That PORTION of code I have copied and pasted and used in a few small bat programs.

Some things that I've changed since the last post are as follows. I saw a post of yours about copying a folder found with the asterisks so you can get it's name. Not sure if I worded that correctly but basically I think I need to find the job folder with

Code: [Select]if exist "%drive%:\%jobNumber%*" (
set temp=%drive%:\%jobNumber%*
xcopy /t /e "%temp%" "C:\TEMP"
)

I keep getting cyclic copy error with that though so I've tried this a few ways like setting the variable temp. I'm only copying the folder and no files so I can later tell the program to look for a folder in the "NY SERVER" with the same name as the copied folder. Maybe I am completely headed in the wrong direction now.

Sorry if this is lengthy but to sum it all up this is what I need the program to do. Find a folder on the "NY SERVER" based on it's first numbers. Then copy files to predetermined sub folders within that job folder.

vvv FULL CODE SO FAR vvv
Code: [Select]@echo off
title Release A Job
color a
set drive=C
set pathStart="%~dp0\job.zip"
set pathEnd=0
set pathEnd1="06. SHOP DRAWINGS"
set pathEnd2="13. PRODUCTION ( In House)"
set pathEnd3="15. INSTALLATION PACKAGE"

:main
cls
echo.
echo Enter the number of your choice and press "Enter"
echo.
echo (1) Enter
echo (2) Change your NY Server Location (Current drive: "%drive%:\")
echo (3) Exit
set /p gateMain=
if %gateMain% == 1 goto step1
if %gateMain% == 2 goto drive
if %gateMain% == 3 exit
goto main

:step1
cls
echo.
echo Enter the job number only
echo.
set /p jobNumber=
set jobFolderCheck=a

set jobFolder=a

if exist "%drive%:\%jobNumber%*" (
goto success
)
goto fail

:fail
color c
cls
echo.
echo THIS JOB DOES NOT EXIST
echo.
echo Make sure your computer has the NY Server Labeled in the %drive%:\ Drive
echo If not you have to change this on the main menu (Option "2")
echo.
pause
color a
goto main

:success
cls
echo.
echo This job was found.
echo No errors to this point
echo.
pause
cls

set temp=%drive%:\%jobNumber%*
xcopy /t /e "%temp%" "C:\TEMP"

set pathEnd="%drive%:\%jobNumber%*"
"C:\Program Files\Winrar\WinRAR.exe" x %pathStart% %pathEnd%

pause
exit

:drive
cls
echo What is the "NY Server's" letter on your computer.
echo For example your main computer is likely labeled C
echo.
echo (Current drive: "%drive%:\")
echo If this does not match your computer's label
echo please enter the correct letter and press "Enter"
echo.
echo Enter "1" to go back to the main menu
echo.
set /p gateDrive=

if exist "%gateDrive%:\" (
set drive=%gateDrive%
goto main
)

if %gateDrive% == 1 goto main
goto drive

If I don't get a cyclic copy error it copies the whole NY server not just the job folder. Any ideas why?
By the way I keep calling it a server but it's really just a drive that is accessible through the company's network.

Code: [Select]xcopy "%drive%:\%jobNumber%*" C:\TEMP /t /e
5636.

Solve : prefix folder name to the new created file?

Answer»

I wanted to have a batch file to help me manage my files without installing additional software.

This is an example of my file naming convention or the final file after renaming ACO-DP-MA-2018-001_01_Proposed_Doc_v1
where:
ACO-DP-MA-2018-001 = the folder the file resides
01 = auto number increment by 1
Proposed_Doc_v1 = file name created by user

I wan't to automatically add the folder name as prefix to the newly created file in that folder followed with an auto number with the exemption of the files which were already prefixed. It should also have auto monitoring for newly created file.

For example when I create a new file inside ACO-DP-MA-2018-001 folder with a file name of Proposed_Doc_v1, my file will be auto renamed into ACO-DP-MA-2018-001_01_Proposed_Doc_v1. Or if I create another file with a file name Report_Doc_v1 in the same folder the final file name will now be ACO-DP-MA-2018-001_02_Report_Doc_v1 and so on and so forth. Else, renaming is skipped if the file name prefix match the folder name.

I don't have any clue or even a starting point to create the script in scratch. What I did was I do research regarding my problem hoping for a solution but I can only find codes in fragments. I don't know how to combine these codes into one.

Script with exemption:

@echo off
rem FILTER all files not starting with the prefix 'dat'
setlocal enabledelayedexpansion
FOR /R ReplaceWithDirectory %%F IN (*.*) DO (
set fname=%%~nF
set subfname=!fname:~0,3!
IF NOT "!subfname!" == "dat" echo "%%F"
)
pause
Prefixed file name with folder name:

@echo off
pushd "Replace with Directory"
for /d %%P in (*) do for /f "delims=" %%F in ('dir /b /s /a-d "%%P"') do
rename "%%F" "%%P_%%~nxF"
popd
To monitor the folder:

@Echo OFF
REM By Elektro [emailprotected]
PUSHD "Replace with Directory"
:: Recycle past session logs
Del /Q "%TEMP%\FileList.tmp","%TEMP%\FileListNew.tmp"
:Monitor_Loop
If Exist "%TEMP%\FileList.tmp" (
Dir /B /A-D > "%TEMP%\FileListNew.tmp"
Echo N | Comp "%TEMP%\FileList.tmp" "%TEMP%\FileListNew.tmp" 1>NUL 2>&1 || (
Echo File changes found on directory.
Call :FileOp
)
MOVE /Y "%TEMP%\FileListNew.tmp" "%TEMP%\FileList.tmp" 1>NUL
) ELSE (
Dir /B /A-D > "%TEMP%\FileList.tmp"
)
REM Ping -n 5 LOCALHOST 1>NUL
Timeout /T 5 1>NUL & REM Avoid Ping while you are in Windows 7/8.
GOTO :Monitor_Loop
:FileOp
For %%# in ("*") Do (Echo "%%~#")
)
GOTO:EOFcan someone help me with this code.
using this ACO-DP-CB-2017_2_001_177-VN-BX_Sec_v5.png as base

where:
2 = file number
001 = GROUP number

The script will only work with one set of group number in one folder.
Note: the part of script which add folder name will only work if one subfolder with one file inside is present.

@echo off
rem filter all files not starting with the prefix 'dat'
setlocal enabledelayedexpansion

set max=0
set oldfilemax=ACO-*.*
for /f "delims=" %%F in ('dir /s /b /a-d %oldfilemax%') DO (
set oldmax=%%~nF
set /a FI=!oldmax:~15,1!
if "!FI!" gtr "!max!" set max=!FI!
rem echo !FI!
)

REM ----this will define the OLD file to match----
set oldfile=ACO-*.*
for /f "delims=" %%F in ('dir /s /b /a-d %oldfile%') DO (
set oldfilename=%%~nF
set /a oldname=!oldfilename:~17,3!

)
REM ----set for the maximum number of file number

REM ----this will define the new file to rename----
set newfile=_*.*
for /f "delims=" %%F in ('dir /s /b /a-d %newfile%') DO (
set newfilename=%%~nF
set /a newname=!newfilename:~1,3!

REM ----this will compare new file and old file----
REM ----first if will prefix 1 if it can't find a match number in old file----
IF NOT "!newname!" == "!oldname!" (
set /a start=1
rem set /a zero=0
rename "%%F" "_!start!%%~nxF"
call :addfoldername
)
REM ----second if will add 1 if it can find a match number in old file----
IF "!newname!" == "!oldname!" (
rem ECHO EQUAL
set /a addnewfilenumber=!FI!+1
rem set /a zero=0
rename "%%F" "_!addnewfilenumber!%%~nxF"
call :addfoldername
)
)

:addfoldername
pushd "C:\Users\Administrator.MMC-EXPLO\Music\New folder"
for /f "delims=" %%a in ('dir /s /b /a-d *.* ^|findstr /iv "aco"') do for /d %%P in (*) do for /f "delims=" %%F in ('dir /s /b /a-d "%%P"') do rename "%%a" "%%P%%~nxa"

5637.

Solve : Increment number base on number in same folder?

Answer»

Filenumber_Groupnumber_filename

I would like to increment filenumber if a duplicate Groupnumber is FOUND. Then restart the increment with other group number.

For EXAMPLE:
If I will save 1_filename it will renamed as 1_1_filename.
If I will save 1_filename it will renamed as 2_1_filename.
If I will save 2_filename it will renamed as 1_2_filename.
If I will save 2_filename it will renamed as 2_2_filename.
....

@echo off
setlocal enabledelayedexpansion

REM this will identify the biggest number
set max=0
for %%x in (*.*) do (
set "FN=%%~nx"
set FN=!FN:~2,1!
if !FN! GTR !max! set max=!FN!
)
rename ....

The code above will only work with only ONE group per folder. Would it be possible to change the script so that it can identify groupnumber from each other in same folder and then add an increment number differently from each groupnumber.

And the other problem with your code is that it will only handle SINGLE digit numbers. Use a FOR /F command instead to break up the file name I to three chunks by using the underscore as a delimiter.Thanks for pointing that out.

5638.

Solve : Echo to txt file Ping string?

Answer»

Looking for a way to echo out the PING command to create a Log File with Date/time and Ping output, so that I can look back at the ping history and look for issues.. Anyone know how this could be done...maybe even post the batch to make it happen.


Thanks for your help in advance...

Looking for a way to Record the Response times of a Triangulated with routers network that we have to prove that we need to set up a priority of service between sites for specific communications over others, and also looking for hot spots where maybe an automated routine can be changed so that bandwidth saturation can be avoided since our VoIP phones degrade badly at these times.

In order to get the money to prove that this is a problem, I have to show real data, and a ping log will do just that.

Thankstry:

Code: [Select]echo %date% %time%>>log.txt
ping *ip adress* >>log.txt
FBA quick hack, just a skeleton. Obviously the IP address (Google) in the script is an example. Many refinements are possible, e.g. set ip=%1, set logfile=%ip%-Pinglog.csv etc and then you can pass the IP as a parameter when you start (or call) the batch and also have logfiles with the IP being pinged in the filename. CSV FILES are readable by MS Excel so you can present it nicely, create charts etc, or you could change the extension to .txt if you prefer.

A possible issue:

The means of generating a delay I have used is sleep.exe which you may have ALREADY and which is part of the (free) Windows Server 2003 Resource Kit.

http://www.microsoft.com/downloads/details.aspx?familyid=9d467a69-57ff-4ae7-96ee-b18c4790cffd&displaylang=en

A method often suggested of generating a delay in a batch script is to ping some IP adress or other, which personally I think is a kludge, especially given that you already have (or suspect you have) network congestion issues, and no delay at all is going to generate lots and lots of ping traffic, and make huge log files.

Code: [Select]@echo off
setlocal enabledelayedexpansion

set ip=66.249.91.147
set delay=60
set logfile=Pinglog.csv

echo "Date","Time","IP Address","Min","Max","Ave">%logfile%

:loop

for /f "tokens=1-26 delims= " %%A in ('ping %ip% ^| find "Minimum"') do (
set min=%%C
set max=%%F
set ave=%%I
set min=!min:ms=!
set max=!max:ms=!
set ave=!ave:ms=!
set string="%date%","%time%","%ip%",!min!!max!!ave!
)

echo %string%
echo %string%>>%logfile%
sleep %delay%

goto loop
Code: [Select]"Date","Time","IP Address","Min","Max","Ave"
"23/08/2008"," 8:06:48.15","66.249.91.147",22,27,24
"23/08/2008"," 8:07:51.34","66.249.91.147",23,29,25
"23/08/2008"," 8:08:54.52","66.249.91.147",23,25,23
"23/08/2008"," 8:09:57.76","66.249.91.147",23,24,23
"23/08/2008"," 8:11:00.93","66.249.91.147",24,26,24
"23/08/2008"," 8:12:04.16","66.249.91.147",23,24,23
"23/08/2008"," 8:13:07.40","66.249.91.147",22,25,23
"23/08/2008"," 8:14:10.68","66.249.91.147",23,24,23
"23/08/2008"," 8:15:13.87","66.249.91.147",23,25,23
"23/08/2008"," 8:16:17.10","66.249.91.147",22,27,24
"23/08/2008"," 8:17:20.30","66.249.91.147",22,22,22
"23/08/2008"," 8:18:23.54","66.249.91.147",23,24,23
"23/08/2008"," 8:19:26.74","66.249.91.147",23,26,25
"23/08/2008"," 8:20:29.98","66.249.91.147",22,24,23
"23/08/2008"," 8:21:33.15","66.249.91.147",24,26,24
"23/08/2008"," 8:22:36.41","66.249.91.147",23,25,23
"23/08/2008"," 8:23:39.60","66.249.91.147",22,23,22

Thanks for the infomation from the both of you and code to make it work...

The version that "Dias de verano" created however looks to be more of what I need a date/time stamp to tag with each recording as shown below:

The response times to this idle network device should be far better than the ms recordings shown below since we have a T1 CONNECTIONS between sites. I hope to roll this out to a number of systems in our triangulated network of 3 large main sites and find the bottlenecks.

One question I have with the data recorded to make sure I fully understand it is that it is recording 3 pings per recorded interval? .... so as seen below the pings of 105, 158, and 127 are the ms response times in that order followed by the next line of 63,163, and 109... so it would be if looking linear at the data like so in ping order ?

105 ms
158 ms
127 ms
63 ms
163 ms
109 ms

------------------------------Data Collected below in pinglog.csv ---------------

"Date","Time","IP Address","Min","Max","Ave"
"Mon 08/25/2008","17:16:29.81","192.168.1.125",105,158,127
"Mon 08/25/2008","17:16:33.03","192.168.1.125",63,163,109
"Mon 08/25/2008","17:16:36.23","192.168.1.125",100,138,118
"Mon 08/25/2008","17:16:39.47","192.168.1.125",97,166,133
"Mon 08/25/2008","17:16:42.70","192.168.1.125",44,91,75
"Mon 08/25/2008","17:16:45.92","192.168.1.125",125,180,147
"Mon 08/25/2008","17:16:49.18","192.168.1.125",77,113,101
"Mon 08/25/2008","17:16:52.40","192.168.1.125",36,125,69
"Mon 08/25/2008","17:16:55.57","192.168.1.125",16,188,106
"Mon 08/25/2008","17:16:58.75","192.168.1.125",75,149,104
"Mon 08/25/2008","17:17:02.00","192.168.1.125",79,152,100
"Mon 08/25/2008","17:17:05.18","192.168.1.125",16,140,100
"Mon 08/25/2008","17:17:08.43","192.168.1.125",71,123,100

If i understand you right you've got the wrong idea. As the titles suggest the three numbers are min, max and average. ping takes four readings as standard.

As usual i bow to Dias de verano's superier knowledge.

FBEach line in the log file contains the time data from one of these:

Code: [Select]C:\>ping 66.249.91.147

Pinging 66.249.91.147 with 32 bytes of data:

Reply from 66.249.91.147: bytes=32 time=27ms TTL=243
Reply from 66.249.91.147: bytes=32 time=35ms TTL=243
Reply from 66.249.91.147: bytes=32 time=23ms TTL=243
Reply from 66.249.91.147: bytes=32 time=26ms TTL=243

Ping statistics for 66.249.91.147:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 23ms, Maximum = 35ms, Average = 27ms <------------TIMES ARE FROM HERE-----------<

Thanks for clearing that up so quickly... This all makes sense now and will work out perfect for my application.

Greatly Appreciated!!

DaveJust wanted to say thank you for not purging this from the website. Almost 10 years later and found a need for it again and it was right here to use again.

Dealing with DSL Internet service provider issue where an old Westell Model 6100 modem is suspect - or - the line coming in to the building. They have done a loop back and said all is well, but when they run their loopback all is well because it is during that time only. They stated they needed proof that its the modem to replace it. So going to use this to log latency and connectivity outages with the ISP.

Just needed to add sleep.exe to the Windows 7 system. Got it from Windows Server 2003 Resource Kit. https://www.microsoft.com/en-us/download/details.aspx?id=17657Quit necromancing old Posts...this is your 2nd warning...


LOL and final one. jk Quote from: DaveLembke on June 18, 2018, 02:10:40 PM

Just needed to add sleep.exe to the Windows 7 system. Got it from Windows Server 2003 Resource Kit. https://www.microsoft.com/en-us/download/details.aspx?id=17657
Why wouldn't you just use the TIMEOUT command that is already part of the OS?Didnt know that command existed. Very Cool!!! Thanks for sharing Squashman.

http://www.robvanderwoude.com/wait.php#TIMEOUT... and I was Dias de Version back then Very Cool Salmon ... Much appreciated in creating that batch for me 10 years AGO. It still has a purpose.

Now I gathered up plenty of data into a csv and will walk into the DSL provider later today with laptop and show the outage issues with them as its in a nice Excel spreadsheet with a graph showing outage frequency and durations as well as another graph of latency going crazy.

Its crazy that they wont just give a newer DSL modem out knowing this one has been in operation for about 8 or 9 years and looks to have had better days. All the many storms its made it through and power outages and brown outs, I think it is starting to show its battle scars and needs to be replaced. Router has no issues and so its the modem or the copper pair. The fun with ISP Providers at times and the finger pointing of their issue vs mine After 10 years the Reskit link still works!
5639.

Solve : Need .bat to launch 2 programs. P1 exits after P2 is closed.?

Answer»

PLEASE HELP!

I want to create a batch (.bat) file that:

1: Launch two applications.
2: Application 1 closes automatically after application 2 is exited manually.

(Using Windows 10... if this info helps)

THANK you an advance!Give this a shot..
Code: [Select]@echo off
set prog1=mspaint.exe
set prog2=notepad.exe
set killcmd=taskkill /f /im

echo "Starting %prog1% and %prog2%..."
start %prog1%
start %prog2%

:check
echo Checking if Program2 (%prog2%) is running...
tasklist /FI "imagename eq %prog2%" | find /I "%prog2%"
echo %ERRORLEVEL%
if ERRORLEVEL 1 (
echo "Program2 (%prog2%) not found in task list. It is not running."
goto notrunning
)
if ERRORLEVEL 0 (
echo "Program2 (%prog2%) found in tasklist. It is running."
goto running
)

:running
echo "Waiting before next check.."
:: Wait 4000ms (4s). Other methods of waiting: http://www.robvanderwoude.com/wait.php
PING 1.1.1.1 -n 1 -w 4000 >NUL
goto check

:notrunning
echo "Stopping Program1 (%prog1%)..."
@echo on
%killcmd% %prog1%
:: The end
WOW! Looks quite complicated! LOL! Thank you for the quick response!

Well it worked exactly how I needed it for all but one program.
The first program which is to close automatically after manually closing the second, doesn't close because of lack of "PERMISSION". I tried giving the exe, and the shortcut and even the folder the program is in administrative privledges and permissions but it still doesn't close. =(

I've tried lot's of things. If you could assist with this I would greatly appreciate it. Much thanks!Might help a bit to post what app it is...The batch file/command prompt wouldn't have permission to kill the task if one of the programs elevates and runs as admin, EITHER itself or through compatibility settings.

In any case I came up with this version:

Code: [Select]@echo off
set prog1=notepad.exe
set prog2=mspaint.exe
for %%P in (%prog1%) do set prog1name=%%~nP
start %prog1%
start /wait %prog2%
tskill %prog1name%

(Of course notepad.exe and mspaint.exe are PLACEHOLDERS!). I think start /wait returns immediately sooner if the program self-elevates, as that typically involves relaunching a new instance of the program and exiting the existing one, s o this could have ISSUES there.You might also try running the controlling batch file in an elevated command prompt, e.g. from Start Menu -> expand Windows System -> right-click Command Prompt -> More -> Run as Administrator.

5640.

Solve : delimited file of variable delimiters?

Answer»

I have a very unusual batch requirement.
I have file with a header and number of rows which are considered as data in the subsequent rows.
Number of header columns can vary and can be determined from the number of delimters. if there are three delimiters in a row - i will have four columns in the file.
The data rows(subsequent rows after the header) are not constant it can vary 2 to end of file

Sample file

Quote

COMPID|COMPNAME|ADDRESS|YEAROFESTABLISTMENT
100|XYC|AWER RD|12072018
120|BNM|PQTY RD|12082018


Required Output will be header rows followed by subsequent rows.In the end of each row i will mention also the FOLDER name(F1) and file name (u1.dat).
There are multiple FILES in each such folders.

1)
Quote
COMPID,COMPNAME,ADDRESS,YEAROFESTABLISTMENT##"100","XYC","AWER RD","12072018"##F1.u1
COMPID,COMPNAME,ADDRESS,YEAROFESTABLISTMENT##"120","BNM","PQTY RD","12082018"##F1.u1

other output of single row
2) COMPID,COMPNAME,ADDRESS,YEAROFESTABLISTMENT##F1.u1

Please how we can we transalate the requirement using batch to obtain the above output.You really haven't specified enough details. Really need to know what the folder structure is and are you expecting each file to have its own output file or are you combining all the files into one.

Regardless of that, here is the base code to do one file. Hopefully you can figure out the rest.
Code: [Select]@echo off
setlocal enabledelayedexpansion

set "filename=u1.dat"
set "folder=F1"

REM Get header row
set /p "header="<"%filename%"
set "header=%header:|=,%"

REM get base file name witout exention
FOR %%G IN ("%filename%") do set "basename=%%~nG"

REM Read file
FOR /F "SKIP=1 usebackq delims=" %%G IN ("%filename%") DO (
set "line=%%~G"
set line="!line:|=","!"
echo %header%##!line!##%folder%.%basename%
)
pauseThanks for the response.

I used your code and not able to print what I actually require

Code: [Select]@echo off
setlocal enabledelayedexpansion
set WORKING_DIRECTORY=%cd%
pushD %WORKING_DIRECTORY%
REM echo %WORKING_DIRECTORY%
for /f "usebackq tokens=*" %%a in (`dir /b/s/a:d MigrationPoc`) do (
echo:%%~nxa
set "vfolder=%%~nxa"
for /f "usebackq tokens=*" %%a in (`dir /a-d /b %%a` ) do (
echo %%a
echo:%%~na
set vfilenamewithext=%%a
set vfilename=%%~na
set /p "header="<"!vfilenamewithext!"
set "header=%header:|=,%"
FOR /F "skip=1 usebackq delims=" %%G IN ("!vfilenamewithext!") DO (
set "line=%%~G"
set line="!line:|=","!"
echo %header%##!line!##!vfolder!.!vfilename!
)
)
)
pause
popD

But issue with reading the file persists and I cannot able to print the line number along with file contents also.

My output is:

Code: [Select]F1
u1.sql
u1
REM THE FILE f1 contains
COMPID|COMPNAME|ADDRESS|YEAROFESTABLISTMENT
100|XYC|AWER RD|12072018
120|BNM|PQTY RD|12082018

rem sample output:
COMPID,COMPNAME,ADDRESS,YEAROFESTABLISTMENT##"100","XYC","AWER RD","12072018"##F1.u1##<line no> 2
COMPID,COMPNAME,ADDRESS,YEAROFESTABLISTMENT##"120","BNM","PQTY RD","12082018"##F1.u1##<line no> 3

The system cannot find the file specified.
The system cannot find the file u1.sql.
b1.sql
b1
The system cannot find the file specified.
The system cannot find the file b1.sql.
c1.sql
c1
The system cannot find the file specified.
The system cannot find the file c1.sql.
d1.sql
d1
The system cannot find the file specified.
The system cannot find the file d1.sql.
Sch_B
File Not Found
Sch_C
File Not Found
Sch_D
a1.sql
a1
The system cannot find the file specified.
The system cannot find the file a1.sql.
b1.sql
b1
The system cannot find the file specified.
The system cannot find the file b1.sql.
c1.sql
c1
The system cannot find the file specified.
The system cannot find the file c1.sql.
d1.sql
d1
The system cannot find the file specified.
The system cannot find the file d1.sql.
Note if the folder contains no file i need to skip that folder which is not happening.Can I get any kind of assistance in this regard? I need a help on this issue.
5641.

Solve : Keep CMD Window Open After BAT Runs?

Answer»

Basic question, I know - but I can never get CH's "Search" to find if things have been answered before...

I have a simple .BAT file. I'd like the CMD window to be open and active (i.e., ready for another command, even if it's just "Exit", after it runs).

If I USE
Code: [Select]pauseof course, it keeps the window open until I tap any key, then it closes.

If I use
Code: [Select] cmd /k before my first command, the window stays open, but is essentially "dead" and won't allow for more commands... I have to manually close the window. Same as if I put just simply Code: [Select]cmd as my last line.

My Googling skills are not up to this task. I keep getting the same answers no matter how I ask. I just want a command prompt after the END of my batch file!

ThanksWhy wouldn't you put CMD /K at the end of your batch file? You said you put it before your first command.Sorry, should have mentioned I tried that too. Same results.

I get a blinking underscore, but it's not a command prompt. The only command I type that works is "exit".

What I'd like is for it to be able to then treat the window as a "normal" CMD window once the BAT runs.

When you execute cmd.exe that is a normal console window. cmd /k works for me at the end of a test batch file. After the batch file completes I get a standard command prompt:

Code: [Select]@echo off
echo doing important work. Please standby
ping 127.0.0.1 -n 6 &GT; nul
echo Critical tasks completed.
pause
cmd /k
(The ping obviously is just to make it pretend to do something!)Quote from: Squashman on March 09, 2018, 09:05:21 PM

When you execute cmd.exe that is a normal console window.
A "normal" console window is some sort of c:\ prompt.... Yes?


Quote from: BC_Programmer on March 09, 2018, 09:19:19 PM
cmd /k works for me at the end of a test batch file. After the batch file completes I get a standard command prompt:
When I run your file, I get a c:\ prompt. Hm. Will start from scratch tomorrow and re-report....

#HeadscratcherQuote from: BC_Programmer on March 09, 2018, 09:19:19 PM
cmd /k works for me at the end of a test batch file. After the batch file completes I get a standard command prompt:
You can see the window title change when you respond to the Pause command and the batch exits.

Quote from: rjbinney on March 09, 2018, 11:13:48 PM
A "normal" console window is some sort of c:\ prompt.... Yes?

When I run your file, I get a c:\ prompt. Hm. Will start from scratch tomorrow and re-report....
Isn't that what you are asking for?
I can use BC's script above, with cmd /k at the end, and after I press a key (because of the Pause command) I see the command prompt and can enter a command e.g. Dir, echo %date%, whatever. I can also make a version of that script, but with cmd /k omitted from the end, and call it from the prompt, like this cmd /k batchfile.bat and the same thing happens. This also causes a return of the prompt if the script has an Exit command at the end.

Rjbinney, are you starting your "simple .BAT file" by double clicking it in WINDOWS EXPLORER, or by typing its name at the command prompt?
5642.

Solve : PCMCIA CF card adapter driver config?

Answer»

Hi!

I got NOTEBOOK with PCMCIA slot and I own PCMCIA adapter for CF cards.
I found two drivers for PCMCIA: CBATA and ATAENAB.
Problem is that they're not free and waiting time is very bad, EVEN I don't know how to configure my device (PCMCIA and work with CF card in).

Can anybody explain me how to configure one of these two?
And maybe - knows anybody any freeware driver?

Thank you for all.
MiroMore likely to find a free driver for Linux for that vs DOS.

Curious why your TRYING to go the CF Card ROUTE with a DOS system? Most people just use a floppy or hard drive for DOS.I need DOS - work in this OS.

MiroGo to the card manuf. site and search for DOS drivers...if they don't have them yer outta luck.

5643.

Solve : Maybe I need helpwith the find utility.?

Answer»

This is about the DOS find UTILITY.

Maybe this COULD be a DOS script. I am not sure. Here is what I want.
I want to look in in all the TXT files I ever made to SEE what email address I have used at any time.

I have found already that I can not use the @ in search. I don't know why. Anyway, here is how I thin it might be done.

Let me say that I use a site called "FarDog.us" as a mail service. some my email address might be "[emailprotected]", but I can not use the @ symbol. So I search on "fardog.us" and select ignore case. In Windows that gives my lots of files.So I copy them all to a USB stick.

{Mot my real e-mail. Just an example herein.}

So far, so good. Now I have a lot of TXT files on my K: drive, my USB thing.

Here is my question. How do I use he find utility to show me just show the fines that have the name of the website?
Quote from: Geek-9pm on June 01, 2018, 02:07:11 PM

I have found already that I can not use the @ in search. I don't know why.

Are you sure?

1. test.txt
Code: [Select]a.line.of.text
[emailprotected]
some.more.txt
[emailprotected]
[emailprotected]

2. tryme.bat
Code: [Select]@echo off
for %%a in (*.txt) do (
type "%%a" | find "@fardog.us"
)
3. Output of tryme.bat
Code: [Select][emailprotected]
[emailprotected]Quote from: Geek-9pm on June 01, 2018, 02:07:11 PM
This is about the DOS find utility.

I have found already that I can not use the @ in search. I don't know why. Anyway, here is how I thin it might be done.

Code: [Select]C:\Batch\Test\>find "@" *.txt

---------- TEST.TXT
[emailprotected]
[emailprotected]
[emailprotected]

C:\Batch\Test>find "@fardog.us" *.txt

---------- TEST.TXT
[emailprotected]
[emailprotected]

use a double FIND to get rid of the file names:

Code: [Select]C:\Batch\Test>find "@fardog.us" *.txt | find "@fardog.us"
[emailprotected]
[emailprotected]
5644.

Solve : batch file to find all the .exe ,mp3,msi files and list the path such file?

Answer»

this is again creating the file on my desktop

just use the full path >>"\\server\share\file.log"

Try this after changing the ip address/server and folder.

Quote from: Aditi GUPTA on June 02, 2014, 04:25:24 AM

@echo off
set "host=\\xx.xx.xx.xx\folder\%COMPUTERNAME%.txt"
echo %host%
for %%a in (c d e f g h i) do if exist "%%a:\" (
dir /b /s /a-d "%%a:\*.exe" "%%a:\*.mp3" "%%a:\*.msi" |find /v /i "c:\program files\" |find /v /i "c:\programdata\"|find /v /i "c:\windows\" >>"%host%"
)
echo "Scanning Completed!!" >> "%host%"
pause
awsome, thanks a lot foxidrive.

you are genius.

Squashman - hand holding, right?Quote from: Aditi gupta on June 02, 2014, 04:25:24 AM

"%host%.txt" >> net use N: \\xx.xx.xx.xx\folder\
This is not valid syntax and please use Bulletin Board Code tags when posting code.

In your original questions it sounded like you wanted to redirect the output from the code directly to the network share. Now it looks like you want to copy a file to the network share. If you want to copy the file to the network share then use the COPY or XCOPY COMMANDS. I believe both of them SUPPORT UNC paths.Quote from: Aditi gupta on June 02, 2014, 05:42:03 AM
awsome, thanks a lot foxidrive.

you are genius.
Yes. It is Rocket Surgery.Quote from: foxidrive on May 27, 2014, 05:15:06 AM
Code: [Select]@echo off
for %%a in (d e f g h i J k l) do if exist "%%a:\" dir /b /s /a-d "%%a:\*.exe" "%%a:\*.mp3" "%%a:\*.msi" >>"%userprofile%\desktop\results.txt"

Hello, Im trying to figure out how to make a bat file and it would ask me what song if like to search for then if I have it to say I have it and if not the to seach it on say youtube automatically
Something like
@Echo off
title Song search
Echo What song would you like to seach today?
Enter name
*Search the name* if not FOUND play the song in youtube

Please help and thank you



5645.

Solve : ICACLS command line doubts.?

Answer»

Good Morning.

I have searched these last days about giving permission in folders through the CMD, and I have almost arrived where I wanted, missing a detail that I do not know if it is possible or not.
See if you can help me.
It has a folder, eg C: \ "Hardware_Test", which is always created on the local disk, but does not have a default, can be in C, D etc.
Using the ICACLS command I wanted to GIVE full permission on this folder to all users.
But I would like to know if there is any command or something of the genre that SEARCHES for that folder and the permission, without having to keep putting all the possible disks in the batch.
For example:

Code: [Select]ICACLS C: \ Hardware_Test / grant "All: (OI) (CI) F" "Administrator: (OI) (CI) F" / T
ICACLS D: \ Hardware_Test / grant "All: (OI) (CI) F" "Administrator: (OI) (CI) F" / T
ICACLS E: \ Hardware_Test / grant "All: (OI) (CI) F" "Administrator: (OI) (CI) F" / T
And so on, if you could search for the folder name and execute ICACLS, you would not have to write multiple command lines, just one.
That is, a command that searches where the folder is, and then run ICACLS.
Does anyone know if this is possible?I think you may have put extra spaces in your command line above. This checks all fixed disks:

Code: [Select]for /f "tokens=2 delims==" %%d in ('wmic logicaldisk where "drivetype=3" get name /format:value') do (
ICACLS %%d\Hardware_Test /grant "All: (OI) (CI) F" "Administrator: (OI) (CI) F" /T
)Or just do this if you already know what drive letters you need to check:
Code: [Select]REM disks to check separated by spaces
for %%d in (c: d: e: f: g:) do (
ICACLS %%d\Hardware_Test /grant "All: (OI) (CI) F" "Administrator: (OI) (CI) F" /T
)Quote from: Salmon Trout on June 01, 2018, 12:21:17 AM

I think you may have put extra spaces in your command line above. This checks all fixed disks:

Code: [Select]for /f "tokens=2 delims==" %%d in ('wmic logicaldisk where "drivetype=3" get name /format:value') do (
ICACLS %%d\Hardware_Test /grant "All: (OI) (CI) F" "Administrator: (OI) (CI) F" /T
)

Thank you very much for the quick response.
This command line that you passed, somehow is giving error.

Code: [Select]\ Hardware_Test: The filename, directory name, or volume label syntax is incorrect.
Successfully processed 0 files; Failed processing 1 files
\ Hardware_Test: The filename, directory name, or volume label syntax is incorrect.
Successfully processed 0 files; Failed processing 1 files
\ Hardware_Test: The filename, directory name, or volume label syntax is incorrect.
Successfully processed 0 files; Failed processing 1 files
Changing the command line, in place of ICACLS I put ECHO %% d, the result gave this:

Code: [Select]C:
D:
E:
I looked at the FOR command (which I did not know) and saw that it was all right (for me at least).
Because the command is transforming the C: | D: | E: in variable %% d.
You are then placing this variable in place of the Local Disk before the rest of the folder.
What could be making this mistake?

OBS: The second alternative that you showed me, worked, but I liked this first more.
OBS2: As test in the computer has the Local Disk C, D and E.Where did you get that ICACLS command from? It isn't right.
Code: [Select]ICACLS C: \ Hardware_Test / grant "All: (OI) (CI) F" "Administrator: (OI) (CI) F" / TI fixed the FOR structure, and more importantly your ICACLS syntax. Did you even test it? You may have to get proper ICACLS permissions for this to work. I cannot help you with that.

Code: [Select]@echo off
for /f "skip=1 tokens=1-4 delims= " %%a in ('wmic logicaldisk get caption^,providername^,drivetype^,volumename') do (
if "%%b"=="3" ICACLS %%a:\Hardware_Test /grant "All:(OI)(CI)F" "Administrator:(OI)(CI)F" /T
)
Oh REALLY?
I'm a beginner in this area, I needed to automate the folder permissions, so I simply went searching and searching until I found something and GOT this command.
Now, if it's not right, I need more help if it's not uncomfortable .
Let me keep you abreast of the SITUATION, many times (for reasons I do not know) the folders of a program (where I work) and the folder PRINTERS, lose permission on some clients, causing them to have to release all manually.
I thought about creating a script that would automatically free these folders.
But as I said, it depends on the client gets on the local disk C another in D and etc.
Can you help me?
EDIT: I saw your second answer after I sent you my message, I'll test it.
Thank you very much.
5646.

Solve : Howto use FTP to send GIF to a list of websites.?

Answer»

Here is my problem.
I am setting up seven web sites with just very simple ine page welcome screen. NOTHING very fancy. Very plain. A fig image ought to have a transparent background. My bad. So I fixed the image, now I have to SEND it to the arrt directory in each web site.

Yes, I should have used a better web builder. My bad. I should know better.

So, how do I FTP to a list of web sites to upload just one GIF image? Is there an easy way to do this in batch. I am very clumzy when I try to use the GUI of my FTP client. A lot of hazzle and I make mistakes.

I already have a list of the site names and they all have a directory named art that holds my GIF files.
I NEED a batch file I can cal from the batch that has the list.
Let's name if _ftp-job.bat
It will get %1 at the site name and %2 as the user name and %3 as the password.
So, how do I write the ftp command inside of _ftp-job.bat?
THANKS for nay help.



It would be better if you stated what yer usin to build these sites...then we can figure out the FTP OPTIONS...
This sites are simple HTML. All have the same layout and almost all of the files the are the same. The sites have UNIX like structure, the main directory is
public_html
The browser will be directed there by the server and the browser will find the index.html file. It makes reference to a GIF that needs to be updated. No need to change index.html. I will just overwrite the GIF with the correct file.
Inside public_html are three directories or interest.
art
images
tiles
The file small_dog.gif has been altered an is in the art directory.
Each web site has different name, of course. And each must have a user name and pass word. User name must always be unique.

The file in this job is always small-dog.gif in directory art in the public_html area on a standard Linux or UNIX server. The FTP port is 21

I am not going to use the actual data.
But here would be a hypothetical list of five websites. [
-----
babytree.com batman 23$wasrit
mycatspaw.win catgirl Qwe&*55
redbulb.us rosy Ynot$23!.
redbulb.info rosy2 Ynot$23!.
wintersalt.net john qwerty123
------
The above is URL, user, password.
A space is used as delimiter, the password might have any printable char.
So how do I write a batch file to use the above?
Thanks.Thats kinda cool how you never answered the question...

5647.

Solve : COPYING a Win3.1 CD ROM TO 3 1/2" DISK in WIN 10?

Answer»

Hi Guys I am new to this forum but have used C_HOPE a few times and didn't know it had a forum etc.
I have a 486DX 33 in use since 1990 and last year the hard drive went. I have finally found the time to get it going again and found that the IDE CD ROM Drive has bought it also.
I remember seeing a program that allows 16 bit dos run in 64 bit windows.
I am trying to copy the WIN 3.1 drivers for an EPSON 600 printer from CD ROM to 3 1/5" floppies.The Fpd is A: USB on my Lap Top, can any one HELP???DOSBOX can run 16-bit in a virtual environment on 32 and 64bit Windows systems. But some games and software dont LIKE the virtual environment.

https://www.dosbox.com/

Ran into an issue like this many years ago and ended up transferring files over a serial connection between 2 systems and a null modem cable using a software trial called filevan.

Given how cheap IDE CD-ROM's are, i'd suggest just replacing that drive and find one for sale that is good used that has a date of manufacturing before the year 2000. In the early 2000s there were some optical drive internal chipset changes and I can into some issues with MSCDEX not liking newer drives for my Windows 3.1 system. Putting in an old Mitsubishi IDE Drive worked while a brand new LG CD-RW drive it didnt like.

Are you stating that you have an original Epson 600 Printer Driver CD - or - are you trying to get them off of a Windows 3.1 Installation CD? ( For Windows 3.11 I never had it on a CD, it was a stack of Floppy Disks to do the Windows installation and one of them was loaded with drivers for a number of printers.

Looking online for the driver i see its 1.98MB, if this is the driver for your printer its too big for a single floppy unless you can span it between floppies or compress it somehow to 1.44MB https://epson.com/Support/Printers/Single-Function-Inkjet-Printers/Epson-Stylus-Series/Epson-Stylus-Color-600/s/SPT_C200001?review-filter=Windows+3.1

Here is the Mitsubishi CR-584-B CD-ROM I had years ago. Others out there of about the same age should work fine as well. The $35 the person wants for this is a bit much. I wouldnt spend more than $15. https://www.ebay.com/i/200992555970?chn=ps&dispItem=1Thank you for the info.
Yes I have the CD and expanded the files in DOS 6.22 then tried to get Win.3.11 to copy them but every time it tried to read the driver file it came up with not enough memory. The CD has a file to expand them into 2 Floppy Disks
I have looked for a new ROM Drive but haven't found one in Oz. there are a lot for sale from Soviet countries but not willing to put my trust in them, plus it would take 6 months to get here. lol.
I will try your suggestions and also try again to find a compatible CD Drive.

THANKS
RachaelQuote

every time it tried to read the driver file it came up with not enough memory.

How much RAM does your computer have? This message may mean that no matter what means of installation you will have not enough memory as an error.

Other thing to be aware of is depending on how you have your autoexec.bat and config.sys files set up you can run into an old problem of base memory being too low which usually can be adjusted to increase the base memory count. The MEM command at DOS prompt will display Base and Extended Memory count. I use to have problems with some software when my available Base Memory was lower than 592k of 640k. http://web.csulb.edu/~murdock/mem.htmlSome things I'm noticing looking over your situation.

The first thing I'm noticing is that all the models I can find that could be the described as an "Epson 600 printer" are (relatively) recent models. They do not provide Windows 3.1 drivers; many don't even provide drivers for Windows XP. Given that I highly doubt that the CD-ROM for the printer provides anything that is of any use to your Windows 3.1 system.

Second thing is that those models of Epson 600 don't even have connectivity capabilities to connect to an older system, as they only offer connectivity via USB or through your network, and network-connected printers require specialized drivers from the manufacturer to function which as I mentioned isn't likely to be on the CD given the age (or lack thereof) of the printer itself.

This is also consistent with your more recent mention that "every time it tried to read the driver file it came up with not enough memory."; in many cases attempting to run executables designed for say Windows XP and later will give a "Program is too big to fit in memory" error.

For compatible Drives, by the by, you don't need a CD-ROM drive; you can use a CD Burner drive or even a DVD drive.

Hi BC... My search for a Epson 600 that supported Windows 3.1 found an Epson Stylus 600 color ... My guess is that this is probably their model as for there are no others found on google in relation to Windows 3.1 support for "Epson 600". https://epson.com/Support/Printers/Single-Function-Inkjet-Printers/Epson-Stylus-Series/Epson-Stylus-Color-600/s/SPT_C200001

Quote
Looking online for the driver i see its 1.98MB, if this is the driver for your printer its too big for a single floppy unless you can span it between floppies or compress it somehow to 1.44MB https://epson.com/Support/Printers/Single-Function-Inkjet-Printers/Epson-Stylus-Series/Epson-Stylus-Color-600/s/SPT_C200001?review-filter=Windows+3.1

This printer has LPT1 ( Parallel port ) connectivity which Win 3.1 would support. Specs here: https://files.support.epson.com/pdf/sc600_/sc600_sl.pdf

Quote
For compatible Drives, by the by, you don't need a CD-ROM drive; you can use a CD Burner drive or even a DVD drive.
Some newer drives work legacy backwards to old systems like this but i ran into problems about 14 years ago with modern IDE optical drives not happy with older systems, however when pairing up an older date code drive with my 386 SX 40Mhz running Win 3.11 then all was well. The newer drives worked fine on my Windows XP system at the time and it wasn't an oops with the Master/Slave/CS jumper setting.

Oh OK, that's good. The Epson search results give a list of models but they don't give much information without actually going to every page and there are quite a few models, so all the ones I looked at were in the 2010+ range.

Obviously because of that it has the appropriate interfaces for older systems.

Regarding Drive compatibility, My understanding is that the limiting factor is the interface (PATA in this case) and system support for ATAPI. As long as that checks out, the drive should work fine with proper drivers. Personally I've not had any problems using OAKCDROM.SYS for all the PATA CD-ROM drives I own (as long as the system has an IDE Host Controller, of course!). Quite useful for transferring DATA to older non-USB systems with DVD-RWs. I seem to r emember reading KB articles discussing support issues with some of the included generic drivers on various Windows Boot diskettes, though.
5648.

Solve : Display Issue in DOS?

Answer» STARTING off, I'm not fluent in MS-DOS at all. I'm OK in later operating systems.

I'm trying to revive an older piece of test equipment which is running Windows 95 but the program that I'm trying to run is a MS-DOS program.

When I run the program it kicks out of 95 GUI into DOS which then start the program but the display of the program is crushed at the top of the screen (see image). The initial DOS portion looks fine and when I restart windows into DOS it looks fine until I try to run this program. From what I've read online, seems like DOS programs/games would often fix the screen resolution in the game config file or it defaults to graphics card native resolution.

Is there a way to force program resolution? I've tried to edit the config of the windows 95 program call (right click on program->properties->Advanced) but I'm obviously doing it wrong since it doesn't seem to change anything. I'm not even sure what the appropriate command would be. Is there a way to force load graphics drivers for my video card in DOS? I've tried both LCD and CRT monitors with no change.

The documentation I have for the program mentions nothing about changing resolution and I've found nothing in the file that I can read in notepad that suggests a resolution setting. I'm not sure if I can just add a command for resolution at the end of a config.sys to make this work.

Computer Specs:
Windows 95 4.00.950.B
Pentium Pro
512MB RAM
20GB Diamond Max Plus
Xpert2000Pro 32M AGP
E139761 Motherboard

Thanks,I'd try a different video card or onboard GPU vs the higher end GPU and see if it is any better.

The fact that a CRT did the same thing to me points to an issue with how the GPU renders the program. So trying a different GPU might be the solution.Going to echo Dave's consideration here. Assuming, that is, the program didn't previously work on this same machine.

A lot of older MS-DOS applications can encounter these sorts of issues with newer graphics cards. The ATI "Rage" series of graphics cards were largely intended for use by Windows (and Macintosh), and suffered from a lot of problems with MS-DOS Graphics. The Xpert 2000 Pro is based on the ATI Rage 128 chip so it's likely to suffer from many of the same issues with regards to MS-DOS compatibility.Thanks for the quick responses. I was wondering if might be an issue but I didn't have a different graphics card to try and the motherboard doesn't appear to have on-board graphics.

Any recommendations for better DOS compatible graphics cards? I'll look online but I if you had something in mind that might work but it would might save me having to buy more than one card.One possible last thing to try for this card, actually. In addition to the "Restart in MS-DOS Mode" option you used, you can also boot more "pure"- this is done by pressing F5 as Windows is starting. (even before it shows the Windows 95 booting logo- I usually just go ham on the KEY as I boot the system) This should boot to plain MS-DOS. You'll be at a C:\> prompt. You'll want to use the cd command to change to and move to the directory containing the software in question and start it by typing the name of it's executable file. (dir can be used to view the contents of the current directory).

(I want to note that the above instructions are only there because you said you weren't fluent with MS-DOS so if it comes off as patronizing, I apologize!)

There is also a possibility that the software is expecting a very specific graphics card; SAY if the software was provided as part of an industrial package as part of the machine. For obvious reasons that could be problematic. I would expect that to be documented but it sounds like you've looked through the documentation and I expect something like that would have stuck out.

Just speaking from my own experience for cards in that "era", I recall that cards from S3 had good MS-DOS compatibility. S3 Trio64V and S3 Virge come to mind in particular.

I've seem glowing reviews about the MS-DOS compatibility of Matrox cards- but I've also heard the exact opposite. In the latter case, the individual was always talking about video games, so it's unclear if it would apply to a more industrial/business software program that uses graphics mode.

Also to note in addition to what BC said, you dont need to go with an AGP card. You can go with PCI as well, but if using a PCI video card the AGP slot needs to be empty of a video card. You might even have an older ISA 8 or 16 bit slot on motherboard too to which you could go with a much older Trident 1MB VGA or SVGA Card or Oak Technology of around the same specs, however going too far backwards with older GPU's means that Windows 95 could run into issues for drivers and 1MB is plenty for most DOS programs, but a 4MB or greater memory capacity video card is best for Windows 95.

Just out of curiosity do you know the system requirements of the software your trying to run? Like was this designed for an 8088 or 286 with CGA or EGA graphics, and your wanting to run it on that Pentium Pro with a SVGA card?


Even knowing what year the software was created would help to pair it better with a GPU of that era, might be able to GET this from date/time stamp of the program to know how old it is if it still retains the original date/time stamp. If this program was copied from one location to another though it could have a newer date/time stamp depending on how it came over from one drive to another etc.sorry about the delay in response, I was getting a different video card and testing other stuff.

So, i got a S3 Trio64V2/DX and things look better. Now, one of the programs looks fine but when I tried to run the other one, I get a error/warning about VESA VBE drivers. I've tried to find and "install" these drivers but I'm not seeing any difference. Do i need to manually set the DOS run of the software to use specific divers (config/autoexec)? I received no drivers with the video card and used what i found online.

I don't know the intended hardware for this system but the software is originally 1996.So what does this software do and its title?

For software created in 1996 seems overly hardware picky! Most software written in the 1990s works with most systems unless the software was written for a specific piece of hardware ( computer system ) to run it.From what I can find, the S3 Trio64V2 has BIOS VESA support. However, You have to run the program directly in MS-DOS for that to work; Windows 95 won't allow that level of BIOS access.

The software is called IC598 and it was made by Sonix for scanning acoustic microscopy. It has a hardware LPT dongle so I assume they are very paranoid about their software. Also, yes, I have contacted Sonix and they sent a nice end of life letter while telling me they wouldn't help me at all since it was EOL.

I just tried running the program in DOS (reboot windows into DOS mode) and it just hangs up on me while doing nothing. The odd thing was when I had the "newer" video card which only shows the top 10% of the screen, this program would open without compliant (apart from the 10% thing).
5649.

Solve : How to find and replace a string in text file using batch file?

Answer»

deepaib123... You want to dynamically build or edit an already EXISTING .C FILE and then compile it?

Trying to FIGURE out what your trying to do.May wanna start a new Topic so it recieves the proper attention as this 1 is 11 years old...

5650.

Solve : How to make bootable floppy which will boot into DOS on HDD??

Answer»

Hi!

I installed MS-DOS 7.10, WINDOWS Vista SP2 x86 and Commodore OS 1.3 x86 (Linux Mint).
I CHANGED active partition to Windows - works, to Linux - works, to DOS - error.
I tried to reinstall DOS and the same.
But when I boot from floppy with MS-DOS 7.10 it found files in DOS partition untouched and software works.
But all settings are relevant to DOS on floppy.

How to make floppy to boot to DOS on HDD?
Is enough to copy AUTOEXEC.BAT and CONFIG.SYS to floppy and it will work?

Thank you for help.
MiroYou can only have 2 active bootable partitions on 1 HDD...so you need to figure out what your priorities are...

Unless you wanna pay for a 3rd party app...System Commander was my personal choice.

BTW just a heads up...you now have 3 active Topics running on the same scenario.Which version of Linux Mint?
Reference:
https://en.wikipedia.org/wiki/Linux_Mint_version_history

IMHO, your best BET is to master the GRUB utility.
http://www.linuxscrew.com/2007/11/21/gnu-grub-simplified-for-newbies/
Quote

GNU GRUB is a boot LOADER package from the GNU Project. GRUB is the reference implementation of the Multiboot Specification, which allows a user to have several different OPERATING systems on their computer at once, and to choose which one to run when the computer starts. GRUB can be used to select from different kernel images available on a particular operating system’s partitions, as well as to pass boot-time parameters to such kernels.

You can put almost any version of Linux with GRUB on a USB drive and get better results tarn a floppy. Linux used to boot from a floppy years ago. The floppy thing would turn control over to the hard drive after doing the boot loader.

Find GRUB links here: https://simple.wikipedia.org/wiki/GNU_GRUB
The article is short but has links to other sites with info about GRUB.You missed the point...he has 3 OS's on the HDD and wants to boot all 3.I need only one thing - two works.
I need only simple floppy which boots to MS-DOS 7.10 on HDD - nothing more, nothing less.
I need not GRUB and others - simple single purpose floppy.

MiroIt's the 1st floppy in the DOS package...info is at the MS site for creating 1.No is not.

I tested it.

Please can anybody explain me problem - simple explain me what to do/change?

MiroSince you aren't likely using a legit DOS ver. my help stops here...First floppy begin MS-DOS 7.10 installation.
2nd is REQ'd in installation.

I have also downloaded ISO.

Miro