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. I don't think I'm explaining what I want very clearlyYes. 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: 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. 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, |
|
| 5605. |
Solve : Can I make a .VBS run like a DOS command? |
|
Answer» HI 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!). |
|
| 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! |
|
| 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 |
|
| 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: |
|
| 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:\). 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.) |
|
| 5616. |
Solve : Joining multiple txt. files and adding part of file name to each row? |
|
Answer» Hi All, |
|
| 5617. |
Solve : Batch file to convert MarkShulze winds txt to CSV file in right format? |
|
Answer» Hi. 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... |
|
| 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. |
|
| 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! 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... You have more than 1 sound card installed ? ?...that may be the issue right there...remove all but the 1 that works best...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. |
|
| 5624. |
Solve : Sending the date to clipboard without opening a command window? |
|
Answer» Hi! 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.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 |
|
| 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? |
|
| 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. |
|
| 5628. |
Solve : Screen resolution change in command line / DOS? |
|
Answer» Hi! |
|
| 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 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. 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 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. It works!!! Really really thanks for your help! |
|
| 5632. |
Solve : Is possible to perform boot by command?? |
|
Answer» Hi! |
|
| 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, |
|
| 5635. |
Solve : Help with unknown path? |
|
Answer» Hello everyone! 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 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. |
|
| 5637. |
Solve : Increment number base on number in same folder? |
|
Answer» Filenumber_Groupnumber_filename |
|
| 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. 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=17657Why 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! |
|
| 5640. |
Solve : delimited file of variable delimiters? |
|
Answer» I have a very unusual batch requirement. COMPID|COMPNAME|ADDRESS|YEAROFESTABLISTMENT 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 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... 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?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! |
|
| 5643. |
Solve : Maybe I need helpwith the find utility.? |
|
Answer» This is about the DOS find UTILITY. 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. 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 @echo offawsome, thanks a lot foxidrive. you are genius. Squashman - hand holding, right?Quote from: Aditi gupta on June 02, 2014, 04:25:24 AM 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.Yes. It is Rocket Surgery.Quote from: foxidrive on May 27, 2014, 05:15:06 AM Code: [Select]@echo off 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 think you may have put extra spaces in your command line above. This checks all fixed disks: 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. |
|
| 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. 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? |
|
| 5650. |
Solve : How to make bootable floppy which will boot into DOS on HDD?? |
|
Answer» Hi! 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 |
|