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.
| 1201. |
Solve : 6.22 format error? |
|
Answer» Does anyone know why I am getting this message? Eventually, data density for disks became too large for the MBR scheme to account for all the available data locations. Also, the layout, or format, of the MBR was designed for early computers and not flexible enough to accommodate newer disk configurations. A new partitioning method was needed so the GUID Partition Table (GPT) partitioning scheme was created.But older operating systems can not boot directly with the GPT. At least I have never heard of anyone doing it. To the best of my knowledge yu have to disable it in BIOS and format a hard drive for MBR. The yu can put an older OS on it and make it potable. The other method is to run an older OS inside of virtual box in Windows 7. This might be of interest: https://www.makeuseof.com/tag/how-to-use-virtualbox/ Quote VirtualBox is a piece of software published by Oracle. It allows you to EMULATE an operating system on your own PC and use it like it’s running on real hardware. You’ll discover tons of uses for virtual machines.Do yu ever use Linux? Linux takes less drive space and can also run DOS in a virtual thing. https://www.linux.com/learn/why-when-and-how-use-virtual-machineThe error in the OP occurs for the reasons it stated. It was unable to create a format recovery file. Either the partition is not yet formatted or is not CURRENTLY formatted to FAT16. Unformat information is saved so that the disk can be unformatted with the UNFORMAT external command, but that only applies if the original file system is FAT16, and possibly in specific other scenarios involving the current drive contents. If it is not you receive this error and prompt- You have not indicated (as far as I can see) what happens if you answer the prompt in the affirmative or use the /U switch that Salmon Trout suggested; considering from what you've stated the drive doesn't contain anything you would want I don't see a reason to be concerned that unformat information is not being saved.I here ya Geek. The retail mobo is old school and has the regular cmos and bios and not the new fangled setup. I had xp on it before on another hd and it worked without a hitch till the hd took a dump on me. What I like about it is that it has a hd boot choice you can prompt with the F8 key at boot. Also; I have used Ranish's boot manager and it works great. Just setup each hd with it and use F8 at boot, select the drive, then select the partition and away you go. If memory serves me right, I remember hearing a kid some years ago had, i think it was, 51 (Fifty One) OSes on one computer. I am only looking at a dozen... BTW, I have several versions of Ranish where one of them lets you have more than 4 partitions but is kind of flaky and makes other partition software freak out so I don't use it. I don't know anything about a GUID Partition Table (GPT), never used it. I have run several Linux distro's and found Debian my fav so far. in kde of coarse... BC, I used the DOS6.22 setup disk to fdisk the drive and format it, correct partition size and format. I haven't tried affirming it yet but will give it a try. Like I said B4, I don't see an un-format on the setup disk and never had B4 and don't know why anyone would when you can just re-format it anyway. j/s... If affirming it doesn't work, I'll go ahead and use the SYS c: and give it a whirl. OK, forget the GUID stuff.Old PCs don't have it. If you think your MS-DOS disks are corrupt, toucan download from another source. Many sites have MS-DOS 6.22 for download. The fdisk command will let you know that you can only have 2 GB for the boot partition. I have a 500 GBdrive with MBR. I have Windows 10 do the boot up and I can select Windows XP, Windows 7 and Windows 10. Also, I have a very small partition for DOS 6.22, but can not boot it. Instead I boot a CD with MS-DOS on it. That small partition has to be the first and it has to be primary. On my old Dell 755 I hit the F12 at start up and it lets me select the CD drive. Of course, when in DOS I can not see the rest of the drive. And I don't want to. Quote from: Noidly1 on January 02, 2019, 06:30:35 PM Like I said B4, I don't see an un-format on the setup disk and never had B4 and don't know why anyone would when you can just re-format it anyway. j/s...UNFORMAT is not on the setup disk. It is on disk 2. The purpose of UNFORMAT is to undo a format operation that was done by accident to a drive that contains data. |
|
| 1202. |
Solve : zero bytes files? |
|
Answer» This one is for my job but I will not get paid for that but it will make my life a bit easier for me so I will PAY from my money. and when 5 of them is one after another. This means what? Quote from: Salmon Trout on February 10, 2019, 05:02:09 AM This means what? it means 5 files are created one by another with zero bytes, like this dat_9_2_2019_18_50.log 0 bytes dat_9_2_2019_19_30.log 0 bytes dat_9_2_2019_20_43.log 0 bytes dat_9_2_2019_22_10.log 0 bytes dat_9_2_2019_23_25.log 0 bytes that 5 files are deleted PC should reboot after that and counter will have number 1 in counter.txt dat_10_2_2019_00_50.log 0 bytes dat_10_2_2019_01_30.log 0 bytes dat_10_2_2019_02_43.log 0 bytes dat_10_2_2019_03_10.log 0 bytes dat_10_2_2019_04_25.log 0 bytes that 5 files are deleted PC should reboot after that and counter will have number 2 in counter.txt dat_10_2_2019_05_50.log 0 bytes dat_10_2_2019_06_30.log 0 bytes dat_10_2_2019_06_43.log 0 bytes dat_10_2_2019_08_10.log 0 bytes dat_10_2_2019_09_25.log 0 bytes that 5 files are deleted PC should reboot after that and counter will have number 3 in counter.txt I get an email that something is wrong and script stop to reboot PC until I delete counter.txt or change number 3 in it to 0 it can be situation like this one dat_5_2_2019_18_50.log 10 Kbytes dat_5_2_2019_19_30.log 0 Kbytes dat_5_2_2019_20_43.log 10 Kbytes dat_5_2_2019_22_10.log 0 bytes dat_5_2_2019_23_25.log 8 Kbytes Files with 0 bytes should be deleted and counter.txt should have 0 in it or like this one dat_4_2_2019_18_50.log 10 Kbytes dat_4_2_2019_19_30.log 11 Kbytes dat_4_2_2019_20_43.log 10 Kbytes dat_4_2_2019_22_10.log 0 bytes dat_4_2_2019_23_25.log 8 Kbytes File with 0 bytes should be deleted and counter.txt should have 0 in it But, logically any five files, listed in time order, will be "created one after another". Quote from: Salmon Trout on February 10, 2019, 06:23:53 AM But, logically any five files, listed in time order, will be "created one after another".Every new file is created about every ~45 minutes from last created file and yes you are rightYour comments please: So this is what you want? 1. Before the first run, create counter.txt and write the value 0 in it. 2. Every 30 minutes the batch will a. Look at folder: c:\administrator\data\ Count how many files are 0 bytes with this name pattern: dat_d_m_yyyy_hh_mm.log NOTE: the file name changes in number of characters, if day or MONTH is greater than 9? So we just use file mask dat_*.log Is that OK? b. if there are fewer than 5, just delete them, leave counter alone. if there are 5 or more, delete them, add 1 to counter, save to counter.txt, if new number is 3, something is wrong, send email (how??) if new number is 1,2, or 3, reboot computer. if number is greater than 3, do not reboot computer, you will manually reset after reading email. Your comments please: So this is what you want? 1. Before the first run, create counter.txt and write the value 0 in it. 2. Every 30 minutes the batch will a. Look at folder: c:\administrator\data\ Count how many files are 0 bytes with this name pattern: dat_d_m_yyyy_hh_mm.log NOTE: the file name changes in number of characters, if day or month is greater than 9? So we just use file mask dat_*.log Is that OK? That is exactly what is should be. b. if there are fewer than 5, just delete them, leave counter alone. OK if there are 5 or more, delete them, add 1 to counter, save to counter.txt, OK if new number is 3, something is wrong, send email (how??) bmail -s mail.myserver.com -f [email protected] -t [email protected] -h -a "Check PC software may not be working" -b "" -m .\path.txt if new number is 1,2, or 3, reboot computer. OK if number is greater than 3, do not reboot computer, you will manually reset after reading email. and delete counter.txt or change number from 3 to 0 BmailI have made a script which generates a logfile, I have tried it (manually not scheduled) with 0, then 3, then 5,5,5 zero byte files. It is still rough, but you can see what it does. You will not really see "Script exit" after "Rebooting computer" because the reboot will exit the script. If the script starts and finds the counter is 3 it just exits, (because you saw the email last time, and are coming to fix). I will just show the logfile now, tell me what you think. 10/02/2019 21:07:30.38 Started script 10/02/2019 21:07:30.40 Count read from file: 0 10/02/2019 21:07:30.60 Zero size files: 0 10/02/2019 21:07:30.60 Script exit ************************************** 10/02/2019 21:07:51.28 Started script 10/02/2019 21:07:51.30 Count read from file: 0 10/02/2019 21:07:51.47 Zero size files: 3 10/02/2019 21:07:51.63 0 bytes dat_2019_02_10_21_07_39.log 10/02/2019 21:07:51.64 0 bytes dat_2019_02_10_21_07_40.log 10/02/2019 21:07:51.64 0 bytes dat_2019_02_10_21_07_42.log 10/02/2019 21:07:51.66 Deleting 3 0 byte files 10/02/2019 21:07:51.82 Rebooting computer 10/02/2019 21:07:51.83 Script exit ************************************** 10/02/2019 21:08:20.46 Started script 10/02/2019 21:08:20.47 Count read from file: 0 10/02/2019 21:08:20.71 Zero size files: 5 10/02/2019 21:08:20.88 0 bytes dat_2019_02_10_21_07_58.log 10/02/2019 21:08:20.89 0 bytes dat_2019_02_10_21_08_00.log 10/02/2019 21:08:20.91 0 bytes dat_2019_02_10_21_08_01.log 10/02/2019 21:08:20.92 0 bytes dat_2019_02_10_21_08_02.log 10/02/2019 21:08:20.94 0 bytes dat_2019_02_10_21_08_03.log 10/02/2019 21:08:20.97 Deleting 5 0 byte files 10/02/2019 21:08:21.16 Found 5 or more files 10/02/2019 21:08:21.17 Count increased to 1 10/02/2019 21:08:21.21 Rebooting computer 10/02/2019 21:08:21.22 Script exit ************************************** 10/02/2019 21:08:46.24 Started script 10/02/2019 21:08:46.27 Count read from file: 1 10/02/2019 21:08:46.46 Zero size files: 5 10/02/2019 21:08:46.63 0 bytes dat_2019_02_10_21_08_30.log 10/02/2019 21:08:46.65 0 bytes dat_2019_02_10_21_08_32.log 10/02/2019 21:08:46.66 0 bytes dat_2019_02_10_21_08_33.log 10/02/2019 21:08:46.68 0 bytes dat_2019_02_10_21_08_34.log 10/02/2019 21:08:46.69 0 bytes dat_2019_02_10_21_08_35.log 10/02/2019 21:08:46.72 Deleting 5 0 byte files 10/02/2019 21:08:46.93 Found 5 or more files 10/02/2019 21:08:46.94 Count increased to 2 10/02/2019 21:08:46.96 Rebooting computer 10/02/2019 21:08:46.99 Script exit ************************************** 10/02/2019 21:09:12.14 Started script 10/02/2019 21:09:12.14 Count read from file: 2 10/02/2019 21:09:12.34 Zero size files: 5 10/02/2019 21:09:12.53 0 bytes dat_2019_02_10_21_08_56.log 10/02/2019 21:09:12.54 0 bytes dat_2019_02_10_21_08_57.log 10/02/2019 21:09:12.56 0 bytes dat_2019_02_10_21_08_58.log 10/02/2019 21:09:12.57 0 bytes dat_2019_02_10_21_09_00.log 10/02/2019 21:09:12.59 0 bytes dat_2019_02_10_21_09_01.log 10/02/2019 21:09:12.61 Deleting 5 0 byte files 10/02/2019 21:09:12.79 Found 5 or more files 10/02/2019 21:09:12.81 Count increased to 3 10/02/2019 21:09:12.82 Sending email 10/02/2019 21:09:12.86 Script exit ************************************** 10/02/2019 21:20:22.67 Started script 10/02/2019 21:20:22.67 Count read from file: 3 10/02/2019 21:20:22.70 Counter was 3 or more 10/02/2019 21:20:22.73 Script exit ************************************** this one will be good only in this situation 10/02/2019 21:07:51.28 Started script 10/02/2019 21:07:51.30 Count read from file: 0 10/02/2019 21:07:51.47 Zero size files: 3 10/02/2019 21:07:51.63 0 bytes dat_2019_02_10_21_07_39.log 10/02/2019 21:07:51.64 0 bytes dat_2019_02_10_21_07_40.log 10/02/2019 21:07:51.64 100 bytes dat_2019_02_10_21_07_41.log 10/02/2019 21:07:51.64 0 bytes dat_2019_02_10_21_07_42.log 10/02/2019 21:07:51.66 Deleting 3 0 byte files 10/02/2019 21:07:51.82 not Rebooting computer 10/02/2019 21:07:51.83 Script exit in this case 10/02/2019 21:07:51.28 Started script 10/02/2019 21:07:51.30 Count read from file: 0 10/02/2019 21:07:51.47 Zero size files: 3 10/02/2019 21:07:51.63 0 bytes dat_2019_02_10_21_07_39.log 10/02/2019 21:07:51.64 0 bytes dat_2019_02_10_21_07_40.log 10/02/2019 21:07:51.64 0 bytes dat_2019_02_10_21_07_42.log 10/02/2019 21:07:51.66 not Deleting 3 0 byte files 10/02/2019 21:07:51.82 not Rebooting computer 10/02/2019 21:07:51.83 Script exit script should leave zero bytes files and next time it runs if there is more zero files like this than it delete and reboot. 10/02/2019 21:08:20.46 Started script 10/02/2019 21:08:20.47 Count read from file: 0 10/02/2019 21:08:20.71 Zero size files: 5 10/02/2019 21:08:20.88 0 bytes dat_2019_02_10_21_07_58.log 10/02/2019 21:08:20.89 0 bytes dat_2019_02_10_21_08_00.log 10/02/2019 21:08:20.91 0 bytes dat_2019_02_10_21_08_01.log 10/02/2019 21:08:20.92 0 bytes dat_2019_02_10_21_08_02.log 10/02/2019 21:08:20.94 0 bytes dat_2019_02_10_21_08_03.log 10/02/2019 21:08:20.97 Deleting 5 0 byte files 10/02/2019 21:08:21.16 Found 5 or more files 10/02/2019 21:08:21.17 Count increased to 1 10/02/2019 21:08:21.21 Rebooting computer 10/02/2019 21:08:21.22 Script exit if script find only 3 zero bytes files than it should leave it so next time it runs if there is 5 files of zero bytes than reboot computer, but if one of last 5 files is full and is not empty than it should delete zero bytes files and reset counter to 0counter = 0 no zero byte files 12/02/2019 20:23:13.24 Started script 12/02/2019 20:23:13.26 Count read from file: 0 12/02/2019 20:23:13.46 Zero size files: 0 12/02/2019 20:23:13.49 No 0 bytes files found; exiting 12/02/2019 20:23:13.52 Script exit ************************************** Counter = 0 3 zero byte files 12/02/2019 20:28:45.94 Started script 12/02/2019 20:28:45.97 Count read from file: 1 12/02/2019 20:28:46.16 Zero size files: 3 12/02/2019 20:28:46.33 0 bytes dat_2019_02_12_20_28_38.log 12/02/2019 20:28:46.34 0 bytes dat_2019_02_12_20_28_39.log 12/02/2019 20:28:46.37 0 bytes dat_2019_02_12_20_28_40.log 12/02/2019 20:28:46.39 Fewer than 5 0 bytes files; exiting 12/02/2019 20:28:46.41 Script exit ************************************** Counter = 0 6 zero byte files (repeated) 12/02/2019 20:32:23.08 Started script 12/02/2019 20:32:23.12 Count read from file: 0 12/02/2019 20:32:23.34 Zero size files: 6 12/02/2019 20:32:23.53 0 bytes dat_2019_02_12_20_30_43.log 12/02/2019 20:32:23.55 0 bytes dat_2019_02_12_20_30_44.log 12/02/2019 20:32:23.56 0 bytes dat_2019_02_12_20_30_46.log 12/02/2019 20:32:23.58 0 bytes dat_2019_02_12_20_30_47.log 12/02/2019 20:32:23.61 0 bytes dat_2019_02_12_20_30_48.log 12/02/2019 20:32:23.62 0 bytes dat_2019_02_12_20_30_49.log 12/02/2019 20:32:23.64 Found 5 or more files 12/02/2019 20:32:23.66 Count increased to 1 12/02/2019 20:32:23.69 Deleting 6 0 byte files 12/02/2019 20:32:23.92 Rebooting computer 12/02/2019 20:32:23.94 Script exit ************************************** 12/02/2019 20:33:40.52 Started script 12/02/2019 20:33:40.55 Count read from file: 1 12/02/2019 20:33:40.75 Zero size files: 6 12/02/2019 20:33:40.94 0 bytes dat_2019_02_12_20_33_24.log 12/02/2019 20:33:40.95 0 bytes dat_2019_02_12_20_33_25.log 12/02/2019 20:33:40.97 0 bytes dat_2019_02_12_20_33_26.log 12/02/2019 20:33:40.98 0 bytes dat_2019_02_12_20_33_27.log 12/02/2019 20:33:41.00 0 bytes dat_2019_02_12_20_33_29.log 12/02/2019 20:33:41.03 0 bytes dat_2019_02_12_20_33_30.log 12/02/2019 20:33:41.05 Found 5 or more files 12/02/2019 20:33:41.06 Count increased to 2 12/02/2019 20:33:41.09 Deleting 6 0 byte files 12/02/2019 20:33:41.30 Rebooting computer 12/02/2019 20:33:41.31 Script exit ************************************** 12/02/2019 20:43:01.70 Started script 12/02/2019 20:43:01.73 Count read from file: 2 12/02/2019 20:43:01.97 Zero size files: 6 12/02/2019 20:43:02.16 0 bytes dat_2019_02_12_20_35_34.log 12/02/2019 20:43:02.17 0 bytes dat_2019_02_12_20_35_36.log 12/02/2019 20:43:02.19 0 bytes dat_2019_02_12_20_35_37.log 12/02/2019 20:43:02.20 0 bytes dat_2019_02_12_20_35_38.log 12/02/2019 20:43:02.23 0 bytes dat_2019_02_12_20_35_39.log 12/02/2019 20:43:02.25 0 bytes dat_2019_02_12_20_35_41.log 12/02/2019 20:43:02.26 Found 5 or more files 12/02/2019 20:43:02.28 Count increased to 3 12/02/2019 20:43:02.31 Deleting 6 0 byte files 12/02/2019 20:43:02.51 Sending email 12/02/2019 20:43:02.55 Script exit ************************************** 12/02/2019 20:44:23.95 Started script 12/02/2019 20:44:24.01 Count read from file: 4 12/02/2019 20:44:24.04 Counter was 3 or more 12/02/2019 20:44:24.04 Script exit ************************************** Script looking verry good but What happends in this case? 12/02/2019 20:43:01.70 Started script 12/02/2019 20:43:01.73 Count read from file: 2 12/02/2019 20:43:01.97 Zero size files: 6 12/02/2019 20:43:02.16 0 bytes dat_2019_02_12_20_35_34.log 12/02/2019 20:43:02.17 0 bytes dat_2019_02_12_20_35_36.log 12/02/2019 20:43:02.19 0 bytes dat_2019_02_12_20_35_37.log 12/02/2019 20:43:02.20 0 bytes dat_2019_02_12_20_35_38.log 12/02/2019 20:43:02.23 10 Kbytes dat_2019_02_12_20_35_39.log 12/02/2019 20:43:02.25 0 bytes dat_2019_02_12_20_35_41.log 12/02/2019 20:43:02.26 Found 5 or more files 12/02/2019 20:43:02.28 Count increased to 3 12/02/2019 20:43:02.31 Deleting 6 0 byte files 12/02/2019 20:43:02.51 Sending email 12/02/2019 20:43:02.55 Script exitIn that case, the 5 zero bytes files are deleted, the count is increased to 3, the email is sent, computer is not restarted. What did you want to happen? In all of these tests these files are also there, they are ignored. 10/02/2019 20:12 37 dat_2019_02_10_20_12_16.log 10/02/2019 20:12 37 dat_2019_02_10_20_12_17.log 10/02/2019 20:12 37 dat_2019_02_10_20_12_18.log 10/02/2019 20:12 37 dat_2019_02_10_20_12_20.log To be clear, the script only counts the files that are 0 bytes. All other files with size larger than 0 are not counted or processed, and their presence or absence does not trigger any actions. |
|
| 1203. |
Solve : another script runed by batch goes into loop? |
|
Answer» I have problem when first batch start second batch than that second batch is runned fev times with 1 second appart. |
|
| 1204. |
Solve : script doesn't work as it should? |
|
Answer» this script should copy log file from local folder EVERY 15 minutes and save it on network, but what I get is random created log files, some fev seconds appart, some ~1 minute appart and some ~10 minutes appart, some ~15 minutes appart. |
|
| 1205. |
Solve : creating a script to copy/backup, maybe robocopy?? |
|
Answer» Hi, guys I tried asking a question before but didn't get MUCH traction on it. can anyone help with the actual code of copying all the files, etc? Maybe Google for "free script writing service"? |
|
| 1206. |
Solve : dos command for lon card ZT 14C92 to connect chassis dynomometer? |
|
Answer» i have RAM-XX DYNO from the 90s, it operates by RAMXX software and connects the DYNO via Lon CARD ZT 14CT92. SYSTEM is DOS 6.22. Contact InformationHi It may be if it is this card http://www.cpuboards.com/zt14ct92 . You may NEED to have an option in the bios to reserve a 16k page of memory for use by the card. If you can copy here listings of the Config.sys and autoexec.bat files from the install floppy or the hard drive we can check them for the above. Was the original computer like this one https://www.bidspotter.com/en-us/auction-catalogues/bsccm/catalogue-id-bsccm10027/lot-166d9b9f-d019-447c-bee6-a47c012d2d66 Also what Graphics card did the original program run under? we may be able to sort this out from the above files. Also can I have the specs of the replacement computer, motherboard CPU, memory. |
|
| 1207. |
Solve : if exist file A or file B? |
|
Answer» I am trying to simplfy script so instead of cheking twice Why don't you just do this? (label :UB doesn't even need to exist) I did that but I thought maybe there is OR which will simplify thisYou don't get a logical OR with the batch IF test. You don't get a logical AND either, but you can mimic this by using two IF TESTS on one line like so Mimic IF exist file1 AND if exist file2 THEN do_something (which doesn't work in batch): IF exist file1 if exist file2 do_something You see how the second IF will only be executed "if" the first one evaluates as true? Well, you can use De Morgan's laws to turn a chain of IF NOTs into the equivalent of OR tests Mimic IF exist file1 OR if exist file2 THEN do_something (which doesn't work in batch): set flag=true IF NOT exist file1 IF NOT exist file2 set flag=false if %flag%=="true" do_something If file1 exists, the first IF NOT test will fail, and the second one will not be executed. the variable %flag% will not be changed, and will stay as "true". This satisfies the OR condition because file1 exists. If file1 does not exist, the first IF NOT test will succeed, and the second one will be executed. If file2 exists, the second IF NOT test will fail, and the %flag% will not be changed, and remains as "true". This satisfies the OR condition because file2 exists. if file1 does not exist, the first IF test will succeed, and the second IF test will then be executed. If file2 does not exist either, the second test will succeed, and the variable %flag% be changed to "false". Thus the OR test fails because neither file exists. The problem is that the above way of doing it uses 3 lines whereas this only uses 2 lines: if exist file1 do_something if exist file2 do_ something However, you can chain a lot of IF NOTS in one line, where the savings of lines will be greater. Test if a number is one of these: 4, 6, 9, 47, 1234 or 9999, in 3 lines instead of 6: echo off set /p "x=Input a number " set flag=true if not "%x%"=="4" if not "%x%"=="6" if not "%x%"=="9" if not "%x%"=="47" if not "%x%"=="1234" if not "%x%"=="9999" set flag=false if "%flag%"=="true" (echo PASS) else (echo FAIL) For that demo, you don't need this, so I took it out: Quote setlocal enabledelayedexpansionNote: The maximum length of any command line (or variable) within CMD is 8191 characters. A single line should not exceed 8192 characters, even after the expansion of %var% or !var! expressions, else you got an error. |
|
| 1208. |
Solve : MS-DOS 7.10 with Windows 3.11 and installation Windows 95? |
|
Answer» Hi! |
|
| 1209. |
Solve : Is possible to boot into XP from DOS?? |
|
Answer» Hi! |
|
| 1210. |
Solve : Run the batch file to dependency job? |
|
Answer» Hi All, |
|
| 1211. |
Solve : Should I allow a plugin to crash my application?? |
|
Answer» I am adding an event driven plugin api to a web based SYSTEM I am WORKING on. The processing power required to test data is so little and so no performance loss to be noticed and a test condition for type or size of the data to be used only requires a few more lines of code usually. This isn't always the case! It will depend a lot on how the validation is performed. For example, When entering an Item number to sell in our "Point of Sale" software, it (obviously!) needs to know whether what was entered is valid. Loading every single item into memory is not an option, however, so it cannot realistically just use say a dictionary of all the valid item numbers - what if somebody just created, deleted, or changed the number of an item? They'd expect it to work, but it wouldn't without having it pull all that data again into the dictionary. Of course, hitting the database isn't usually expensive. One can check if an item is valid by "merely" checking a particular database view to see if that item number is associated with an item ID. If not, the item number isn't valid. if it is, then we also know what the item ID is which is used to load it in. But, customers are a pretty tricky bunch. Just being able to accept an Item Number isn't enough. They want to be able to get the item loaded in by scanning one of it's barcodes, or by typing in a SERIAL number, or perhaps they'd like to type in the item number that one of their vendors uses for the item, rather than theirs. That can mean that verifying something entered isn't valid can be quite the undertaking computationally. And even if it is valid, it might be looking in 3 or 4 different places before actually finding what it really is and being able to associate it with the Item. The really fun part we are finding is that while many of the things we want to "cross reference" to get the relevant items are available via database views, joining on database views is incredibly slow on postgres. There are some additional performance issues in that it needs to then load up that Item in order to know how to function with it (eg Serial Items need to prompt for the serial number, fuel needs to ask for a pump, and some other stuff like that)... that is (arguably) part of validation, too, but it's rather problematic because when it comes to loading item information apparently we decided "in for a penny, in for a pound" and it loads pretty much everything associated with the item. That makes sense for easy stuff that's pretty much flat in the database but when selling an item means it has to wait for the item to bring in the full quantity change history for the item and every single price change since forever I think it's no surprise that we're seeing performance issues now that customers are getting more historic data from that change! Kind of funny that this never occurred to us when adding it. |
|
| 1212. |
Solve : Endpoint Encryption...Subscription??? |
|
Answer» I have used Whole Disk Encryption before but it was a one time download PGP Universal Server enters learn mode once a subscription license expires. ... encrypted with PGP Whole Disk Encryption will automatically decrypt after 90 days. https://support.symantec.com/en_US/article.TECH149025.html Looks like to KEEP the encryption you need to make sure that you RENEW the subscription with symantec. |
|
| 1213. |
Solve : remove charter from a text files? |
|
Answer» how to remove a $ charter from a text file? |
|
| 1214. |
Solve : Scripts strange behaviour? |
|
Answer» I don't know what happend with these scripts. 1. Think what you were doing at 18.45 on 11th March. at that time script is runned by task scheduler. I have alredy checked viruses but there is none of itDid you do the Notepad thing? Quote from: Salmon Trout on March 12, 2019, 12:27:22 PM Did you do the Notepad thing? yes, two times. funny thing is on win 10 that is not happening but on win 7 on some PCs.What did you see in Notepad??+ + + 1... Quote from: patio on March 12, 2019, 12:51:42 PM + + + 1... He needs to help us help him.....with more info. Hopefully that'll happen...maybe not.Surprise batch file in ROOT of C:\ ... first thing to do: find out what it does. Quote from: Salmon Trout on March 12, 2019, 01:32:32 PM Surprise batch file in root of C:\ ... first thing to do: find out what it does. Yes I checked that. It is not one batch but all of them. batch like copy files, check archive, check installed software, etc. all of them on some windows 7 PC WRITE directly on C: when batch is started than when batch finish it is gone, but not for all. this is one of it Code: [Select]for /f "delims=" %%d in ('dir /s /b /ad %1 ^| sort /r') do rd "%%d" 2>nulI still don't understand. Can you make a bigger effort with your English? Are you saying you made these scripts yourself? Quote from: Salmon Trout on March 12, 2019, 01:40:28 PM I still don't understand. Can you make a bigger effort with your English? Are you saying you made these scripts yourself? yes or copy it from internet, I BASICALLY know what they do and it was tested. problem is I latelly notice they write somekind of temporarry files on C: question is why? probably some settings in windows? it is strange for me as it is for you, because basically all should start in c:\windows\system32 |
|
| 1215. |
Solve : delete unused folder and it subfolders? |
|
Answer» I have trouble to search for unused folders and delete it. The problem is not stated clearly.I forget to say these files are about 80 of them differend date and time. So script should find the latest one and if that file is older than 60 days than top folder and all under it should be deleted and also if there is none of that files in folder, it should delete top folder and all under it. LOGL_201902sr_200756.txt LOGL_201902sr_184156.txt LOGL_201902sr_183141.txt LOGL_201902sr_162522.txt LOGL_201902sr_150501.txt Is this for your job? Quote from: Salmon Trout on February 07, 2019, 09:51:54 AM Is this for your job?no this is private related, why?Sometimes we get "write me a script please" requests on here, and I am pretty sure some of them are for people who need it for their work, so we write the script and the OP gets paid for it. Anyhow, do you want to use the file creation date or last modified date? Quote from: Salmon Trout on February 07, 2019, 11:16:45 AM Sometimes we get "write me a script please" requests on here, and I am pretty sure some of them are for people who need it for their work, so we write the script and the OP gets paid for it. What a crap of people making money on people good will to help. I glady pay for a COFFE to anyone which helps me, but never think of selling this kind of someones else job. On my job I also never get paid for any scripts. Anyhow, do you want to use the file creation date or last modified date? You mean of these files? LOGL_201902sr_200756.txt these files are created and never modified, so it is file creation date.1. Can you run vbs scripts? 2. What should happen if logfiles subfolder is not there? Quote from: Salmon Trout on February 07, 2019, 11:38:34 AM 1. Can you run vbs scripts? if it is possible I rather run batch, because if I need I can change a bit as much my knowledge allow me. If there is no subfolder or file in it than also it should be deleted.I just want to use an external vbscript function to calculate the file age in days, because there is no native way of doing that in batch. You will see when I show you a test batch script in a short while. Please try this test script. It won't do anything to your files. It will create a file called agedays.vbs in the same folder as the batch. Put the batch in the top folder. See above, I put it in the top folder called test. For the test run there is a folder called Jerry with no logfiles.txt. Tell me if it gives results. echo off setlocal enabledelayedexpansion set maxdays=60 echo Max file age %maxdays% days set "thisfolder=%cd%" echo wscript.echo DateDiff("d",wscript.arguments(0), Now) > agedays.vbs for /f "delims=" %%A in ('dir /b /ad') do ( echo. set delfolder=NO echo check folder %%A if not exist "%%A\logfiles" echo NO LOGFILES FOLDER & set delfolder=YES cd "%%A" If exist "logfiles" ( cd "logfiles" for /f "delims=" %%B in ('dir LOG*.txt /b /a-d /od /tc') do ( set thisfile=%%B set thisdate=%%~tB for /f "delims=" %%C in ('cscript //nologo "%thisfolder%\agedays.vbs" "!thisdate!"') do set fileage=%%C ) echo newest file !thisdate! !thisfile! !fileage! days if !fileage! gtr %maxdays% set delfolder=YES ) if "!delfolder!"=="YES" echo DELETE FOLDER %%~dpnA & echo. cd /d "%thisfolder%" ) My output: Max file age 60 days check folder Jack newest file 17/01/2019 20:21 LOGL_201902sr45341M.txt 21 days check folder Jane newest file 03/02/2019 12:39 LOGL_201902sr19909M.txt 4 days check folder Jerry NO LOGFILES FOLDER DELETE FOLDER E:\test\Jerry check folder Jim newest file 03/02/2019 12:39 LOGL_201902sr23088M.txt 4 days check folder Joe newest file 13/11/2002 17:27 LOGL_201902sr35804M.txt 5930 days DELETE FOLDER E:\test\Joe check folder John newest file 03/02/2019 12:39 LOGL_201902sr16730M.txt 4 days Coffee ? ?...that's it ? ? ? |
|
| 1216. |
Solve : XP NTLDR and adding DOS to boot menu? |
|
Answer» Hi! |
|
| 1217. |
Solve : Random number between 2 other numbers? |
|
Answer» How could you make a BATCH that picks a random number between 2 other numbers? I know how to pick a number from like 0-10 but how can you pick a random number from 100-150? This picks a number from 10-25 but im still confused why it works It works because, in this line: set /a R=%random%%% 16 +10 1. %random% selects a random number between 0 and 32767 2. %% 16 takes the remainder after dividing it by 16. This will be between 0 and 15 3. + 10 adds 10 to that giving a number between 10 and 25. To get a random number between X and Y where X is the lowest number and X is the highest number ALLOWED, take %random% modulo ((Y-X)+1) and then add Y. This means: (USING your numbers) From the highest number (25), take away the lowest number (10). 25 - 10 = 15 To this, add 1 15 + 1 = 16 So you make set /a do this: %random% %% 16 The result will be between 0 and 15. Now you add the lowest number (10) This gives you a number between 10 and 25 Quote from: shanked on November 27, 2010, 12:59:51 AM i know it's not the best method so please post if you have a better idea. Given the limited tools available in batch scripting, it isn't bad. It is quick to run and is only one line of code. A strict mathematician might say that the results are pseudo-random. It depends what you want it for. It is OK for a batch game you are WRITING for a learning exercise or if you are playing around. Quote from: Me To get a random number between X and Y where X is the lowest number and X is the highest number allowed, take %random% modulo ((Y-X)+1) and then add Y. Correction of typo: To get a random number between X and Y where X is the lowest number and Y is the highest number allowed, take %random% modulo ((Y-X)+1) and then add Y. Wow thanks a lot! I actually understand how it works now I know this has been resolved years ago.. but for those who is/are interested in alternate solution... here it is... (without much calculation of random numbers) :start echo off set /p min_num= Enter minimum number (single digit only): set /p max_num= Enter maximum number: :begin Rem rnum - min random number for single digit OUTPUT only Rem runm2 - max random number for set rnum=%random:~1,1% set rnum2=%random:~1,1% rem condition of two random single digit numbers. if %rnum% lss %min_num% goto begin if %rnum% leq %min_num% set /a newnum=%rnum%+%rnum2% if %rnum% gtr %min_num% set newnum=%rnum%%rnum2% if %newnum% gtr %max_num% goto begin echo %newnum% |
|
| 1218. |
Solve : Elegant Batch File to Make Folder and Copy 2 Specific file into? |
|
Answer» Hi Folks What is the rule that decides which files get moved to which folder? Hi and thanks for getting back to me. Currently I've a very large Excel file (1200 lines) which I'd like to edit and then save a a txt file, so I can use this as the basis of my batch. Each line of the xls file currently has, 2 columns Column1 is name Name of the Folder and Column 2 is the name of the of file, all files are unique and the folders are usually referenced twice, as most folders should end up with 2 files moved in. Hope I'm making myseld clear. Thanks Biscuit Please show a sample of the Excel file. Hi Thanks for getting back to me Here is a sample of the spreadsheet (which could end up being over 2000 lines long). Currently all the files are in a single folder, so all file names will be unique. Folder names are defined and will usually be referenced 2-3 times in the spreadsheet as each is ASSOCIATED with 2-3 drawings. Looking for a nice script that will both generate the folder and move each file into it's RESPECTIVE folder. Thanks BiscuitYou can make the lines of a batch script in Excel itself; I often do this. Have Notepad open. Step 1. Create commands to make the folders if they don't already exist (you can skip this if each folder does already exist, but it won't do any harm if you run it) I am using the letters for the columns, and numbers for the rows, as they are in your example spreadsheet. I hope you can see the formula in cell D3. Copy this down so it is in column D all the way down. Duplicated folder names won't matter. Highlight the cells in Column D that have the formula and paste into Notepad first. Step 2. make the commands to move the files Again, I hope you can see the formulas Highlight and copy the formulas in Column E into Notepad, below the commands you did in step (1) above. Finally, in Notepad, save the TEXT as a .bat file in the folder where the .dwg files are located, and run it. If you don't want to see the commands scroll past, put echo off as the first line of the batch. If you want the batch window to stay open until you press a key, put pause as the last line of the batch. The other alternative is to save the columns with the .dwg filenames and the folder names, from Excel, as a .csv file and make a batch to process that. Let me know if that is preferable. Quote from: Salmon Trout on March 29, 2019, 12:29:47 PM The other alternative is to save the columns with the .dwg filenames and the folder names, from Excel, as a .csv file and make a batch to process that. CSV file looks like this (I called it MyFile.csv for this exercise): Code: [Select]FOLDER,DRAWING Product 0021,765-245.dwg Product 0107,963-541.dwg Product 0956,524-890.dwg Product 0584,769-527.dwg Product 0022,835-245.dwg Product 0096,963-523.dwg Product 0021,192-879.dwg Product 1584,769-524.dwg Batch file Code: [Select]echo off for /f "skip=1 tokens=1-2 delims=," %%A in ('type MyFile.csv') do ( if not exist "%%A" md "%%A" echo Moving file "%%B" to folder "%%A" move "%%B" "%%A" ) echo Finished pause A third possibility is to use Visual Basic Script (which is on all Windows) to directly extract the data from the Excel spreadsheet, and I have been working on that, but as this thread has gone silent, I am not inclined to spend any more time on it. A fourth would be a VBA macro, (but likewise). Many Many Thanks for your response looks very interesting Sorry I didn't reply earlier I took "She Who Must be Obeyed" away for a long weekend with strict instructions to leave the laptop begind Anyway will try tonight Thanks Alot BiscuitMany thanks Salmon Trout Yes that works fine, thanks alot, just think it's a shame that the MOVE command doesn't have an option to generate a folder if it doesn't exist. Your EFFORTS much appreciatedd Biscuit |
|
| 1219. |
Solve : Enable system protection from command prompt? |
|
Answer» We have a Lenovo All-in-One Desktop running WIN 10 that won't boot up following an automatic update. Just one day previous, the HP desktop (also WIN 10) did the same thing and was resolved by performing a System Restore. When we ATTEMPTED a System Restore on the Lenovo it says it can't do it because the drive is not protected and we need to enable system protection. |
|
| 1220. |
Solve : How to check console window width columns in bath script?? |
|
Answer» Hi |
|
| 1221. |
Solve : only one instance of batch? |
|
Answer» I have this script which prevents to run two instances of the same batch. What does that tell you?Sorry, really have no clueDid the ping command work both times?I told you WAY up above you shouldn't use a variable called PATH or path in your scripts. Maybe you didn't read that. You didn't ask why. You don't understand anything about batch scripts, which makes it risky to run scripts you found on the web, and doubly risky to alter them when you don't know what you are doing. You could try something like this below, but maybe you would be better off actually trying to learn how to write your own scripts? or another language? People say good things about Python. echo off setlocal enabledelayedexpansion echo my name is %~nx0 echo now I look for my name using Tasklist set found=0 for /f "delims=" %%A in ('tasklist /v ^| find "cmd.exe" ^| find "%~nx0"') do set /a found+=1 echo Found this batch in Tasklist %found% time(s). if %found% gtr 1 ( echo Script with same name already running echo Exiting... pause exit ) REM rest of script echo If I reached here I am the only %~nx0 running pause yes you are right. I have intention to take class for powershell and learn that. I know using path which is command is not good like using the name of the batch as some exe program in script. I learn something but still need alot of it to learn. thank you when I test this notepad opens everytime when I run it but it should not. Code: [Select]echo off setlocal enabledelayedexpansion echo my name is %~nx0 echo now I look for my name using Tasklist set found=0 for /f "delims=" %%A in ('tasklist /v ^| find "cmd.exe" ^| find "%~nx0"') do set /a found+=1 echo Found this batch in Tasklist %found% time(s). if %found% gtr 1 ( echo Script with same name already running echo Exiting... pause exit ) notepad.exe echo If I reached here I am the only %~nx0 running pauseI thought you wanted a batch which would only allow one running instance of itself. Quote from: Salmon Trout on March 28, 2019, 09:54:25 AM I thought you wanted a batch which would only allow one running instance of itself. Yes it should run only one instance of batch but I see sometimes is runned two or more. That's why I was searching for a script which will prevent starting another when first one already runs. So script which I post it do that, but problem is I can't set a path where it SAVE that lock files. When I run that script, while it is still running, if you open a new command window, and run it again, the new instance exits without starting Notepad. Quote from: Salmon Trout on March 28, 2019, 11:43:24 AM When I run that script, while it is still running, if you open a new command window, and run it again, the new instance exits without starting Notepad.When I do that it opens notepad everytime. I tested 3 times and opened 3 notepads. |
|
| 1222. |
Solve : Need help creating a batch file to change multiple folder icons in Win 10? |
|
Answer» Hey all. I recently upgraded to Win 10. On my old 7 setup, in my movie COLLECTION folder, the movie folder icons were images of the movies renamed to "folder". Everything worked well. Since the upgrade, Windows 10 crops the images named "folder" and it no longer works well. I have decided to replace the technique of using a jpg renamed "folder" to actually using icons of the movies. My issue is that I have hundreds of folders that I would like to apply this to. As of right now, I am moving the .ico into the folder, right clicking and going through he process of changing the ICON for that folder. This will take me months. I was wondering if ANYONE here has an idea for a batch file that would look in the folder for an .ico file and, if there is one, replace the default windows icon for that folder with the one I have moved in there. |
|
| 1223. |
Solve : Help With Creating A Batch File To Read The 2nd To Last Line Of Text? |
|
Answer» Hi, I need some help on creating a report file by reading the 2nd to last line of text |
|
| 1224. |
Solve : Batch file for multi folders? |
|
Answer» So i want to make a .bat or .exe file on the desktop thats open up 6 Explorer windows arranged in a specific position with specific paths to folders on different drives. File Explorer, previously known as Windows Explorer, is a file manager application that is included with releases of the Microsoft Windows operating system from Windows 95 onwards. It provides a graphical user interface for accessing the file systems. It is also the component of the operating system that presents many user interface items on the monitor such as the taskbar and desktop. Controlling the computer is possible without Windows Explorer running (for example, the File | Run command in... More Info »There are over two-dozen software things that allow more visuals options... FreeCommander muCommander Explorer++ MultiCommander Quote Perhaps the most famous and most used Explorer alternative, MultiCommander, is the application that does it all. Like Explorer++, it provides a portable version (created by the installable version). And, like both of the previously mentioned alternatives, MultiCommander gives you a tabbed interface. (Only the tabs appear on the bottom.) An' lots more.. Have you tried any of these o others? Thanks very much i didnt realy found any Programm thats fits my needs But i will Look into that and try them all Simply said my main goal is to get fast to this 6 folders VISUAL sortet after i restart my PC. preferable a 1 klick solution As it is now i have 6 links on the desktop. After I opened them i drag an drop them to there Position. Its not realy much work But its anoying if i do this multiple Times a dayTry Windows Manager. Not free. http://www.desksoft.com/WindowManager.htm Quote WindowManager HELPS you to improve your work flow by remembering and restoring the position and size of your programs and windows. Many programs don't remember their position and size between sessions and even Windows Explorer does not restore windows to their last position under Windows 7 or higher. This is where WindowManager steps in and makes sure your windows are placed exactly where you want them every time you open them. WindowManager even allows you to lock the position and size of any window, so that it will always open at the same spot no matter where you move it. The window handling is fully customizable and you can set up special rules for your favorite or most frequently used windows. You can also make WindowManager send KEYSTROKES or mouse-clicks to a PROGRAM when its window is opened,I have not tried it. It cost $10 and I have yet to pay this month's bills. The batch solution offers no way to position the windows. The Powershell solution using Internet Explorer creates an object where you can position the windows. There are syntax errors in the new-object cmdlet but you have the right idea. Try using this syntax: Code: [Select]$ie1 = (New-Object -ComObject InternetExplorer.Application).Navigate("D:\Downloads") Another solution you can try would be to let Powershell position the windows automatically instead of you doing it manually: Code: [Select]$shell = New-Object -ComObject Shell.Application Invoke-Item -Path "D:\Downloads" Invoke-Item -Path "Z:\" Invoke-Item -Path "S:\Z Work Flow" Invoke-Item -Path "S:\Modden\My Mod" Invoke-Item -Path "S:\mod organizer\mods\my mod\meshes\actor\charakter\my mod\armor" Invoke-Item -Path "S:\mod organizer\mods\my mod\textures\actor\charakter\my mod\armor" Start-Sleep -Seconds 3 $shell.TileVertically() Be aware this solution has a 3 second delay between the last window opened and positioning the windows. Also, the TileVertically method will tile all the open windows on your desktop. Good luck. Thank you very much All you for your Great Help. I will test if i can make it work with Power Shell. |
|
| 1225. |
Solve : Mapping Network Drive with Bat Files? |
|
Answer» Could someone help me along in making a bat file to map network DRIVES when i run the bat file ?It is the same as GOING to command prompt and TYPE NET use. U just put the COMMANDS into a text file and save that file as .bat |
|
| 1226. |
Solve : How To Move Then Delete SQL Dump File? |
|
Answer» I am trying to use a batch script to move a SQL dump from 1 server to a different one. The script I'm using will create the file and copy it but when I try using the MOVE command it only creates the file. I've INCLUDED the script below, any thoughts on how I can do this? |
|
| 1227. |
Solve : How to read first 2 bytes of selected file in DOS or command prompt by BAT? |
|
Answer» Hi! is used with byte data contained in a string. Instead of returning the character code for the first character, AscB returns the first byte. He's right you know... I think results can vary with your current codepage, unless you use MIDB to get the byte out of the string (as well as ASCB). Anyhow, this one uses the ADODB.Stream object. Miro, give it a try... echo off echo Const adTypeBinary = 1 > 2bytes.vbs echo filename = "%~1" >> 2bytes.vbs echo Set BinaryStream = CreateObject("ADODB.Stream") >> 2bytes.vbs echo BinaryStream.Type = adTypeBinary >> 2bytes.vbs echo BinaryStream.Open >> 2bytes.vbs echo BinaryStream.LoadFromFile FileName >> 2bytes.vbs echo buf = BinaryStream.Read >> 2bytes.vbs echo BinaryStream.Close >> 2bytes.vbs REM Decimal or... rem echo wscript.echo ASCB(MIDB(buf,1,1)) ^& "," ^& ASCB(MIDB(buf,2,1)) >> 2byte.vbs REM Hex echo wscript.echo Hex(ASCB(MIDB(buf,1,1))) ^& "," ^& Hex(ASCB(MIDB(buf,2,1))) >> 2bytes.vbs for /f "tokens=1,2 delims=," %%A in ('cscript //nologo 2bytes.vbs') do ( set byte1=%%A set byte2=%%B ) echo Byte 1 is %byte1% echo Byte 2 is %byte2% That works perfectly! To all mentioned things: I know that first code was not made for filetype and I know that files have headers and IDs, in case encoding also each character can be written differently. When I asked no matter of type I mean always first two bytes - not characters, not other units, first two bytes of file beginning. I was very surprised in first code that it was handled as text input, but I don't know VBScript, so I could change only few things. Binary access is required for raw data and so is handled last version. Quotes were problem and I see in new code that were handled by simple command line parameter. Thank you for all your work. Miro Quote from: MIRKOSOFT on April 25, 2019, 01:46:27 PM I know that first code was not made for <any> filetypeIt was meant to work for any file type. I'm sorry for bad English. I meant: It was not for filetype. I gave into brackets any 'cause it was not for TXT, not for BMP, not for XLS, that it was for each. I had to write: It was for each filetype - but I'm not sure if it is in English correct. MiroBut does it work for what you want? Yes, works and thank you very much. MiroThat's good. |
|
| 1228. |
Solve : search in log for file names in folder? |
|
Answer» Not sure what I am doing wrong here... You can't set + read a %...% type variable in a loop; you have to use delayed expansion and use ! instead of % around the variable name. |
|
| 1229. |
Solve : MS-DOS 7.10 and LOCK command to enable/disable direct IO access to disks? |
|
Answer» Hi! |
|
| 1230. |
Solve : Remove characters from a text file? |
|
Answer» Hi, been STRUGGLING to get this to work. |
|
| 1231. |
Solve : name input? |
|
Answer» How do i do this? |
|
| 1232. |
Solve : Control GUI options from a Batch file? |
|
Answer» I am RUNNING a batch file that edits the registry, but I don't want the user prompted to add the CHANGES, I just want it to add the settings.http://jpsoft.com/tcmddes.htmAutoIt http://www.autoitscript.com/autoit3/ is the utility I use for STUFF like this. |
|
| 1233. |
Solve : New Windows 10 terminal? |
|
Answer» I wonder if anyone has tried the NEW Windows Terminal? It's in the Microsoft Store (Win 10 only). I know it's just an alpha release, but it seems fairly complete. Of course now I'm down the rabbit hole. Yup. A whole Saturday. Quote I couldn't get the command line to work directly, instead it would always start the distro bash itself, but not run ssh- even though the same wsl command in command prompt did in fact start SSH. Note: each profile must have a unique GUID, I got mine from a web GUI generator. Odd. I did it like this... in a profile, the "commandline" string value is like this (you aren't using bash.exe are you? Use wsl.exe.) -u name is your USERNAME in the wsl distro -l name is your remote host username wsl.exe -d Legacy -u mike -e ssh 192.168.0.5 -l mike you have to get the wsl -d distro name right, mine is "Legacy", it's WSL Ubuntu from before the distros got in the Windows Store. Find out your name(s) by doing wsl -l at the cmd prompt. Should work, I think. Quote My only real complaint about the application itself though is that the tabs are in the titlebar. I've always disliked that trend (Thanks Google Chrome...) In this case, It means moving the window requires using the area right next to the caption buttons. In the settings JSON, in the Global section, change the Boolean value showTabsInTitlebar to false Hope this helps. Quote wsl.exe -d Legacy -u mike -e ssh 192.168.0.5 -l mike Everything after -e is the wsl bash command Thanks, I think it must have been the guid, changing it worked. I imagine what happened is it ended up somehow using data from both- I think I had considered the GUID but figured it couldn't matter since it did use the new name in the drop down; but when SELECTED must have been identifying it based on GUID and therefore grabbing the command line for the standard Ubuntu profile. Quote In the settings JSON, in the Global section, change the Boolean value showTabsInTitlebar to falseBrilliant, my only real issue has a config!Re the GUID, that was my learning path, too. I just copied the whole WSL profile and tinkered around, but initially left the GUID the same, like you. I wish the tab text could be customised to say e.g. "Pi", Debian", "WSL", etc. but you can change the icons. As supplied the icon paths look like ms-appx:///ProfileIcons/{0caa0dad-35be-5f56-a8ff-afceeeaa6101}.png. On my install that leads to a png in C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_0.2.1715.0_x64__8wekyb3d8bbwe\ProfileIcons, but you can make it any path you like e.g. c:\myicons\debian.png. The ability to set a custom icon for each profile means that each tab can have its own visual identity, but what appears as tab text is inconsistent; the ssh session on the Debian machine has the Debian prompt, but the Pi retains the wsl.exe command line. |
|
| 1234. |
Solve : DOS inexpert needs help with one little command line? |
|
Answer» Hi |
|
| 1235. |
Solve : Fdisk Doubled my hard drive? |
|
Answer» HELLO |
|
| 1236. |
Solve : ms-dos boot disk? |
|
Answer» I have windows xp home. I found the links to make an MS-Dos boot disk and did so. My problem is that the boot disk has no CD-rom support. I would LIKE to install an earlier version of windows for those NOSTALGIC days of X-Com and the like but I can't even edit the boot disk. The edit command gives me a "Bad command" message. Any ideas?http://www.bootdisk.com has boot disks with CD support. |
|
| 1237. |
Solve : prompt? |
|
Answer» what is prompt |
|
| 1238. |
Solve : Changing 'A' prompt to CD drive prompt? |
|
Answer» When booting with a start up disk - Win 98, Norton rescue or 'restart in MS-Dos mode'-- into the dos mode, I can get an "A" drive prompt. I can change that to my "C" drive prompt (and also my "D" & "E" prompts as I have my hard drive partitioned into three drives). However, I can't change it to my Zip drive ("F") or my CD drive ("G"). If there a way to do this? The purpose being to access one of those drives to run a virus check such as Symantec's Pre-Scan available from their website (the program will not fit on 3 1/2" floppies so I have to use a R-RW CD or Zip disk. Plus, at one time in the past when I also was running MS-Dos and Dosshell under Win 3.11 I could do all of this. What can I do to access my Zip & CD drives after booting into Win98 dos? Thanks for any help or references you can give me. Tom |
|
| 1239. |
Solve : can i build new external commands?? |
|
Answer» Hi, |
|
| 1240. |
Solve : Can I log into a network with a batch file? |
|
Answer» I'm trying to USE a .bat to log into a nework. |
|
| 1241. |
Solve : Batch File - Run Next Program When 1st Complete? |
|
Answer» Hi, Can anyone help with the CODE that would be required to do the following : execute program c:\download.exe and ONLY WHEN THIS FINISHES, execute program c:\import.exe end download.exe creates a file CALLED c:\output.raw so would I need to check to see if this has stopped being created ETC or is there some other WAY I can check for download.exe FINISHING before running import.exe? Help appreciated. Thanks. G.Under plain MS-DOS, you can just put the two programs in the batch file one after the other, the second program won't be invoked until the first one terminates. If this isn't what you're talking about, please be a bit clearer on what you're trying to do. |
|
| 1242. |
Solve : How do I Un-minimize the prompt after an user minimized it?? |
|
Answer» My problem is quite simple |
|
| 1243. |
Solve : Copying registry from one computer to another? |
|
Answer» Hey, I was wondering what will happen if I'll copy one registry files from a laptop to a desktop computer, also the way I was thinking about it is go into the registry and make export file and then move it to the desktop computer with Disk-On-Key and then just use it as a backup. So, will it work fine for my desktop computer if I will do it? |
|
| 1244. |
Solve : If/and code? |
|
Answer» Is there a CODE I can use in this case? |
|
| 1245. |
Solve : Batch file Count within folders of specific name? |
|
Answer» Hi All, |
|
| 1246. |
Solve : Issue regarding variable initialization in dos script? |
|
Answer» Hello Gurus, |
|
| 1247. |
Solve : print to com port? |
|
Answer» need help! |
|
| 1248. |
Solve : Add string to certain position? |
|
Answer» Hi all, But if you're editing the file, sed will serve you well Quote sed 's/^.*$/&\ \ \ /G' some_file > some_other_file |
|
| 1249. |
Solve : cant get out of dos? |
|
Answer» every time i start my computer i goes to DOS mode and command screen i type exit but it WONT LEAVE dos mode and i CANT get back to window HELP |
|
| 1250. |
Solve : How to close an Access Database in Dos? |
|
Answer» I am try to FIND a dos command to CLOSE a currently opened access database. I am using XP. Will TASK KILL work and if so how do I USE it |
|