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.
| 5801. |
Solve : Saving and resuming for batch RPG? |
|
Answer» Hey, I have began working on a batch RPG and I can't SEEM to find any information on how to make code where it saves where you left off, maybe like a resuming code, but I can't seem to find any INFO on that.It depends entirely on your RPG code - but essentially you can echo each variable into a text file and read the text file when you need to restore the variables.Say you had 3 variables called power, voltage and ENERGY |
|
| 5802. |
Solve : DOS Search Replace Random Numbers? |
|
Answer» Good Day |
|
| 5803. |
Solve : date compare? |
|
Answer» @ECHO OFF |
|
| 5804. |
Solve : Create folder using part filename and move? |
|
Answer» Hello All, move files to that newly created folder, and then append the date modified to the end of the files within the new folder. You are using the current date in your code, yet you asked above for date modified. The code below should create folders for the username and then move the two .pst files to the folder. It doesn't do the date requirement - it's not clear as yet. Code: [Select]@echo off for /f "delims=" %%a in ('dir *.pst /b /a-d ^|find /i /v "-archive" ') do md "%%~na" & move "%%a" "%%~na" & move "%%~na-archive%%~XA" "%%~na" |
|
| 5805. |
Solve : VBS The "send using" configuration value is invalid? |
|
Answer» Hello i am trying to send a email to myself through vbs script with a file attachment using a code that i found online but i keep getting an error STATING (The "send using" configuration value is invalid). Anyone can explain what im doing wrong and how to fix it? |
|
| 5806. |
Solve : Weekday backup script? |
|
Answer» Hi EXPERTS, |
|
| 5807. |
Solve : ">" and ">>" in Batch files and parameters to them? |
|
Answer» Hi all, >>out_log.log 2>&1 copy /Y %1 somefile.txt So, I see the name of the LOG file and that there is a COPY going on of "somefile.txt". I also see that %1 is the first parameter to my BAT file, but I really have no idea about the "2>&1" means. Your help is appreciated.Quote from: tboyerva on March 14, 2016, 09:01:23 AM Code: [Select]>>out_log.log 2>&1 copy /Y %1 somefile.txt EDIT: Your example is legitimate syntax, it's just not often written with both redirections at the beginning. It's the same as this code: Code: [Select]copy /Y %1 somefile.txt >>out_log.log 2>&1 In the example below are two kinds of output - the screen output and the error output. They are both seen on the screen in normal use, but when redirecting output to a file you will GET the screen output, but not the error messages. They CALL these things streams, and STDOUT is the normal screen output while STDERR is where errors are generally written to. STDOUT is represented by number 1 STDERR is represented by number 2 Code: [Select]dir 1>>out_log.log 2>&1 The code above shows the DIR output being APPENDED to the file >>out_log.log and while I added the 1, you will always see the 1 on the console if you use echo on with the batch file. The portion 2>&1 shows that the STDERR stream (number 2) is being sent to the same place as number 1 (>&1) and number 1 has been set to go to the file out_log.log. So what the COMMAND does is send both the screen output and the error messages to the file out_log.log. You will never see >> in the 2>&1 syntax, it is always just one > character. This example will send the DIR 1 output to the NUL device and it will disappear, and STDERR is being sent to stream 1 so it disappears also. No screen output will show at all. Code: [Select]dir >nul 2>&1 In this example the DIR output goes to the file, and all error messages are hidden. Code: [Select]dir >file.txt 2>nul Lastly, there are 9 streams but 1 and 2 are the ones that are most often used in code.Thanks so much. It has been some 30 years since I had to write or modify batch files. |
|
| 5808. |
Solve : Taskkill? |
|
Answer» I have a Batch file that I use to close MULTIPLE programs using 'Taskkill". I use th"/f" option to force the closure, but even so, "Access Denied" is returned. The program I try to close ends just fine manually. I have searched other places with not MUCH help. This automatic closure action is important and needed in this batch file. THANKS for your help.you have to start that batch process as administrative privileges, but I am the Administrator and logged in. Did you actually try to right click on the script and select "RUN as admin..." ? Being admin is not the same as it once was - there are restrictions in some cases.Quote from: foxidrive on March 17, 2016, 05:48:53 AM Did you actually try to right click on the script and select "run as admin..." ? yeah,thanks foxidrive, that's exactly what i am trying to explain ! |
|
| 5809. |
Solve : Cant ignore special character no matter what I do? |
|
Answer» Okay I will make a brief explanation on showing what i'm trying to do. I'm trying to make a program that will start google chrome for me each time Okay I will make a brief explanation on showing what i'm trying to do. I'm trying to make a program that will start google chrome for me each time the computer starts. I didn't read any further than to see that VBS is being used. Why not use a batch script in the startup group?The vbs file is used to start a specific batch file invisible, the vbs file is generated from the batch file, which is suppose to be a install batch file Why invisible? What's the point in this? It looks like what you've described is not what you want, or what you're doing.because i dont want to display the prompt when the batch file starts. The file doesn't require user input nor does it display any messages. there is no point in displaying the cmd window so i run it invisible instead. When i add a options menu, i wish to display that file instead because it does require a visual prompt to use, and i do not wish to display two prompts just because i wish to run a file in a specific folder from that options menu. The vbs code works fine, the problem is when i create the vbs file from the batch file, specific spacial characters is needed to be ignored or else when the batch file creates the vbs file, the code in that vbs file will not display that character and thus resulting in an error when the vbs file is started. the command line wont let me ignore that character because the "&" sign has to be ignored with the "^" sign, but also the "^" (For example ~ "^&") must also be canceled out (For example ~ "^^&") i cannot ignore the fist "^" sign in "^^&" because it interferes with the other "^" sign in "^&", and thus again resulting in an error.This for general reference: Programs or shortcuts placed in the Startup folder will run whenever Windows starts. Click the Start button , click All Programs, right-click the Startup folder, and then click Open. Open the location that contains the item to which you want to create a shortcut. Right-click the item, and then click Create Shortcut. Most likely Zask will ignore this simple answer. Quote from: zask on March 24, 2016, 06:15:59 PM because i dont want to display the prompt when the batch file starts. zask, if you want people to use their free time to help you, then be up front with what you want to do. If you want to start chrome when your computer starts - without a batch window showing - then drag a shortcut from chrome into your startup group. If you want help to use a character in a line of code, then just show the line of code and ask your question.i am being front, all i need to know is how to ignore a ^ sign in front of ^& Quote from: zask on March 26, 2016, 06:31:40 PM i am being front, all i need to know is how to ignore a ^ sign in front of ^& Code: [Select]@echo off echo >"%TEMP%\start.bat" @echo off echo >>"%TEMP%\start.bat" start chrome.exe echo >"%TEMP%\makevbs.bat" @echo off echo >>"%TEMP%\makevbs.bat" set "file=%%APPDATA%%\Microsoft\Windows\Start Menu\Programs\Startup\run.vbs" echo >>"%TEMP%\makevbs.bat" echo ^>"%%file%%" Set WshShell = CreateObject("WScript.Shell") echo >>"%TEMP%\makevbs.bat" echo ^>^>"%%file%%" WshShell.Run chr(34) ^^^& "%%%%TEMP%%%%\start.bat" ^^^& Chr(34), 0 echo >>"%TEMP%\makevbs.bat" echo ^>^>"%%file%%" Set WshShell = Nothing Quote from: Geek-9pm on March 24, 2016, 08:55:53 PM This for general reference: Works! :/Quote from: zask on March 31, 2016, 04:42:11 PM Works! :/ This is perfect! Here's an image you can use as an icon, zask. http://www.educationduepuntozero.it/Risorse/Racconti-ed-esperienze/2010/09/img/clandestini16_big.jpg Quote from: foxidrive on April 01, 2016, 06:38:10 AM Here's an image you can use as an icon, zask. Funny lol |
|
| 5810. |
Solve : Change all filesname with log? |
|
Answer» Hello Better File Rename has features like what you require... but its not free. Not sure if you checked into that. hello Dave i know execute programs for file rename. but, i dont use it.. because.. i will create batch file for different format renames and will add to mouse right click on register very easy and can use whenever time click Code: [Select]Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\Directory\Background\shell\ReName] "SubCommands"="" "MUIVerb"="ReName" [HKEY_CLASSES_ROOT\Directory\Background\shell\ReName\shell] [HKEY_CLASSES_ROOT\Directory\Background\shell\ReName\shell\alphanum] "MUIVerb"="alphanum" [HKEY_CLASSES_ROOT\Directory\Background\shell\ReName\shell\alphanum\command] @="\"C:\\____Batch\\ReName\\alphanum.bat\"" You've shown the same 3 filenames that you want in 6 different formats. It's unclear what you are actually after. Quote from: TosunPASA on March 27, 2016, 06:05:15 AM text1.txt ===> 270320161428001.txt (27 day, 03 month, 2016 year, 14 hour, 28 min, 001 is first number)Is that you Zask ? ?@foxidrive yes.. i wanna change file names with different 6 format mean.. if you can help me i will use 6 batch file for renamesQuote from: patio on March 27, 2016, 09:45:43 AM Is that you Zask ? ? dont know Zask i am archiving my files with different renamed to database.. for security. wanna use log file for restore I browsed some past posts from you, and in this task you really need to explain clearly what you are planning to do.@foxidrive i am archiver user dont use formated file names.. files COMING to my disks... and i modify file names... i am not coder and.. i wanna create new record types for archive and need new file name formats yes.. dont thx much before helps to me. i know. but i am very simple userExplain clearly what you are planning to do. @foxidrive file original names, very long or very short. users dont use standart file name and dont use alphabetic soooo... file name problem on archive... we wanna use different format on db and we will insert original filename with changed name to db but.. we will archive all files our masked type (format) not original names. else... different alphabet and different file name lenght... Clear as Mud...There sure is a lot of mud there. TosunPASA, show us a list something like this and explain the rules you need to follow to rename the files. Quote "peter's book.txt" "New name for peter's book.txt" Via PM Quote from: TosunPASA hello You didn't say so, but it's looking like you want to rename every file in a folder to destroy the filenames, but keep them in a log file so they can be renamed back to the original names. How much do you charge for this service? I get the impression now that it's foreign characters in filenames that is causing the problem. They cause problems in batch scripts too - and putting the foreign names in a log file is not a reliable way to extract them again as they will be 8-bit characters, or Unicode characters, or the code page will be a factor in restoring them too. Why don't you archive each file with a sequential number as the archive name?because... original filenames not standard length and different alphabetic codes i will insert renamed files to same directory will be standard length, example "char(12)" or timed number or with uniq name (word) mean.. i will use different rename format for different times and work if you will hack my disk, you cant know which file - from where i will insert log file to different DB on different location. when i need that original file.. i will merge db records |
|
| 5811. |
Solve : From here to there and back again? |
|
Answer» Actually the Batch itself is actually is in a different directory, but the Output is being written to c:\working. cd /d %currdrpth% Put this on the lines above it. You'll see what it inside the variable and be able to figure out the oddness. Mind you that isn't where the error you see is being generated, UNLESS & is in the variable. Add pause here and there to track it down. Code: [Select]ECHO cd /d -%currdrpth%- pause |
|
| 5812. |
Solve : Hi all - trying to count files in a folder and pass it to a var can you help? |
|
Answer» hi the following counts all the files in a given folder and passes the value to a log file |
|
| 5813. |
Solve : batch script to monitor folder size? |
|
Answer» Hello |
|
| 5814. |
Solve : CMD fun? |
|
Answer» What are some fun THINGS and tricks you can do in command prompt? I feel like having a little fun with the mostly unused feature! is there a way to make it change color like your code WHILE it runs?Nope. That's like asking a batch file to print something while you are saving it to the desktop. Quote Is it possible to run a batch file full screen? INot that I know of... You could have a look at the Mode command though. Code: [Select]mode 200,200Tnx for the quick answer. Unfortunate, but kinda expected. As your example indicates Heh, it's like trying to drink from a glass while you're filling it up No no!, THAT's perfectly possible There is a sleep command that comes with the Win2003 Resource Kit or you can make do with the poor man's ping command: Code: [Select]@echo off for %%a in (A B C D E F 0 1 2 3 4 5 6 7 8 9) do ( for %%b in (A B C D E F 0 1 2 3 4 5 6 7 8 9) do ( color %%a%%b echo All Your Chameleon Supplies Here ping -n 3 127.0.0.1 > nul ) ) Maybe this will give you some ideas. Code: [Select]@echo off :1 for %%a in (A B C D E F 0 1 2 3 4 5 6 7 8 9) do ( for %%b in (A B C D E F 0 1 2 3 4 5 6 7 8 9) do ( color %%a%%b ) ) goto :1This looks pretty....Is it possible to output characters to predefined rows/columns, or do you just need spaces and enters to get that effect? could be the start of some simple command prompt GRAPHICS..To run it in full screen you could just create a shortcut and under the properties of the shortcut select full screen, that works.Oh sweet, I kinda assumed that wouldn't work for the command shell :SQuote from: Schop on June 15, 2008, 08:15:08 AM Oh sweet, I kinda assumed that wouldn't work for the command shell :SGlad i was of help |
|
| 5815. |
Solve : Count how many times a number is seen in a text file.? |
|
Answer» Hi All, Is there a way to rename the following lines "---------- BIGFILE.TXT: 21" etc.. To "Number found for 016501 is: 21" ?.Yes. You could do something like: Code: [Select]for /f "tokens=2 delims=:" %%a in ('find.exe /C "016501" "bigfile.txt"') do ( echo Number found for 016501 is %%a >> "count.txt" )Or to make it even more efficient, you could run all your numbers in another FOR loop like: Code: [Select]for %%n in (016501 013512) do ( for /f "tokens=2 delims=:" %%a in ('find.exe /C "%%n" "bigfile.txt"') do ( type "bigfile.txt" | find.exe "%%n" >> "Master.txt" echo Number found for %%n is %%a >> "count.txt" ) )Sweet...! That worked like a charm... Although I don't fully understand how that line works but I am GAINING knowledge everyday from this website and your help... for /f "tokens=2 delims=:" %%a in ('find.exe /C "016501" "bigfile.txt"') do ( echo Number found for 016501 is %%a >> "count.txt" ) Thank you again Ken Countme.bat Code: [Select]@echo off setlocal enabledelayedexpansion set string=%1 set /a count=0 for /f "delims==" %%A in (bigfile.txt) do ( echo %%A | find "%string%">nul && set /a count=!count!+1 ) echo Found %string% !count! times usage Code: [Select] S:\Test>if exist count.txt del count.txt S:\Test>Countme 016501 >> count.txt S:\Test>Countme 013512 >> count.txt S:\Test\Batch\Countline>type count.txt Found 016501 15 times Found 013512 14 times S:\Test> Quote from: ktrueb on September 06, 2008, 12:22:05 PM That worked like a charm... Although I don't fully understand how that line works but I am gaining knowledge everyday from this website and your help...
I hope that helps you understand it better. You can also look at http://technet.microsoft.com/en-us/library/bb490909.aspx or try Code: [Select]FOR /? for more information.Thank you sir Ken |
|
| 5816. |
Solve : COMPARE DATE MODIFIED WITH CURRENT DATE? |
|
Answer» thankx "ghostdog74" i'll fine out the error and i'll tell you Code: [Select]IF "%1" == "" S:\AISHA\MSG *.TXT GOTO SER_DATE strFolder=" S:\out" Try removing the space before the S:\outQuote the one is calculated as one day how can i convert it to min. ? Do the arithmetic in minutes: Code: [Select]If DateDiff("n", strFiles.DateLastModified, Now) > 15 Then I think this was the original code. Something may have gotten lost in the translation. There seems to be a FUNDAMENTAL flaw from the very first post. From the ambitions / intentions expressed in the comments it appears that :- a) Any recent file that is less than 15 minutes of AGE is to be archived; b) The above rule will exclude from archiving any thing created / altered in the next 45 minutes, unless the SLEEP period is reduced from 60 minutes down to 15. Regards Alan |
|
| 5817. |
Solve : dos comand? |
|
Answer» hia can any one help i have a hard drive just for music does any one know what the dos comand is soo i can print what is on my hard drive to make a list of my music thanksI havn't tried this, but i think this should do it: |
|
| 5818. |
Solve : Loading From Server.? |
|
Answer» Say on my SERVER I have a file NAMED: |
|
| 5819. |
Solve : Looking Up Accounts.? |
|
Answer» Say I have a text file like so: |
|
| 5820. |
Solve : clarification? |
|
Answer» I'm glad you tried it...yeah., i had tried it.,., but every EXECUTION is failed.,., what others execution can harm the SYSTEM files?? TROUGH MS DOS??We are not going to help you RUIN someone's computer.sorry..,., i was just curious if, i'am a limited user and i will use the MS DOS.,., ?? can i harm the computer? this is still a big question to me>..,./.Quote from: r3ynz_t4nz on September 01, 2008, 11:45:05 PM sorry..,., i was just curious if, i'am a limited user and i will use the MS DOS.,., ?? can i harm the computer? this is still a big question to me>..,./. You have been told YES already. Now move on. |
|
| 5821. |
Solve : Creating a Batch Program to Copy Files with unique/ incremental names? |
|
Answer» Hi All, |
|
| 5822. |
Solve : add 1 minute to current time in 24H Format..??? |
|
Answer» how can i get the current time in 24H format, then add 1 minute to it..?? and what are you going to do at 23:59? Throw spider monkeys into the temporal time portal worm hole that will open because of celestial quantum 24-Hour time format dimensional pole shift paradox....HUH..?? I Will Do This Becuz That Is Where The Real Enemies Are.. In The Futuer An Advance Race Of Unstopable Mechanised Imigrant Chinabots & Mexiborgs Will Travel Back To Earth In Time Machines Clone Our Jobs An Beam Them Back To Thier 3rd World Mother Ships Controlled By A Danny Davito Clone.. And Dont Forget About The Burden That These Uninsured Mexiborgs Will Put On Our Health Care Systems.. They'Re Mexiborgs Dude.. They'Re Poorly Made, Remeber They'Re From Mexico.. But Theres Still Time.... Thers Still Time.. Ehh.. Ehhh.. To Send Me Into Zee Future... I Will Disquiese Myself As A Mexiborg And Go By zee Name Raoool-5000 I Will HANG AROUND Zee Time Machines And Say Things Like "Hey Guys Its Pretty Nice Here In The Future No Need To Go Back To The Present" And Then They Will Say "Don't You Mean The Past" And I Will Say "Why, Did I Call It The Present, My Mistake" And Then They Will Say "Hey..!! He'S From The Past, Get Him..!!" Then I'll Tear Of My Virtual Poncho... Take Out My Twin Gatling Guns... And Blast All Zee Chinabots & Mexiborgs Away -- In Slow Motion... Take Da Cigar Out Of My Mouth. Turn To Zee Camera And Say "Now Thats A Blast From zee Past 23:59..!!!"I meant, how are you going to cope with the rollover of hours and minutes that happens at midnight? Your dumb answer didn't make me want to help you very MUCH. Try to grow up. Would you have to write some kind of "subroutine" to check if you're going to "00" in the minutes field, then you "bump up" the hours field by 1 ?? I'm hoping my idiocy doesn't blind everyone! If we actually knew what the OP was trying to achieve, we could deliver a more focussed solution that has been possible so far. dude, if you have the patience, you can just wait for 1 min using ping or sleepYou can use VBscript to get the uptime (now), compute the uptime in 60000 milliseconds time, then in a loop keep checking if the uptime value has exceeded the computed value. |
|
| 5823. |
Solve : goto label%time%?? |
|
Answer» For some reason when I run this it just exits. Is it because the times I have aren't the current times? For some reason when I run this it just exits. Is it because the times I have aren't the current times?SIDEWINDER????? :-? :-? :-? :-?You already have an unending loop. What do you think the chances of GETTING the GOTO statement to run at exactly 12:00:00.00 (down to the millisecond) are? I would suggest you use the task scheduler to run lunch.bmp and 605.bmp at the correct time. Good luck. 8-) I just realised that too!!Quote from: Mr. Google on April 02, 2006, 08:30:38 PM I just realised that too!! Yea, right! I was so stupid back then. I'm soooo sure that I realized that. HAHAMr Google.........Why are you bringing back old topics? Quote :label12:00:00.00 And this is a broken label Quote from: Carbon Dudeoxide on September 02, 2008, 03:05:34 AM Mr Google.........Why are you bringing back old topics? I thought this was FUNNY? I aint laughing. Quote from: Carbon Dudeoxide on September 02, 2008, 07:34:54 AM I aint laughing. Well i am... |
|
| 5824. |
Solve : How to get a batch file to send a .txt file to an ftp server?? |
|
Answer» How to get a batch file to SEND a .txt file to an ftp server? |
|
| 5825. |
Solve : run hyperterminal from a .bat? |
|
Answer» Can anyone assist me with the proper FORM , syntax for RUNNING hyper TERMINAL from a .bat file.Hyperterminal has no command line switches and exposes no activeX interface, both of which make it difficult to script. |
|
| 5826. |
Solve : IP Address from File? |
|
Answer» I am attempting to pull an IP address from a file and then use that IP address later in the script for different things such as tracert and ping etc. SERVER.DB line can look like this So, are you saying that a SERVER.DB line always has SERVER.DB at the beginning, then a = sign and then you will always find the IP address? Is that right? That is a correct statement. In fact it is very easy to isolate the IP address. In your code, simply CHANGE this: "tokens=1,2 delims==" to this: "tokens=1,2 delims== " so that there are now 2 possible token delimiters, the = sign and also white space, therefore in any lines which have anything after the IP address, e.g. ;DB Files that will not be in the second token %%U Thank you Sir once again for your help. I can start a new thread for this as it is on a pretty large tangent, but basically is there a way to get the version of an application from dos? From Windows you can hover over an *exe or go to the version tab in properties, but can dos pull this information and output to a file? Telnet, I use telnet from a command PROMPT to confirm connectivity to a certain server on a certain port, if the connection fails visually on the dos prompt it will tell you, but if it works your no longer in dos, is there a way to batch this to log to a file saying telnet success or telnet failed? Then continue in the original dos prompt. I'm assuming to some DEGREE errorlevel could be used by maybe calling another bat file, but if it is successful I have no idea how to get back out of telnet to continue with the script. |
|
| 5827. |
Solve : Random # of lines in a large text file? |
|
Answer» I'm not sure I follow what that code means... Does that code create a percent of what is entered into %var%? no it makes "15%" of streets in file where you have them all, so you dont have to change code like sidewinder SAYS but using my method is not exact to real 15% found the problem: Code: [Select] set /a max=%num%/100*15 change to this: Code: [Select] set /a max=%num%*15/100then will be exact 15% Quote really only want to use between 10 and 25 streets you mean this ? Code: [Select]:LOOP set /p var=Enter how many streets you need: if %var% lss 10 goto LOOP if %var% gtr 25 goto LOOP hope that helps Thx for all the help, I appreciate it. Heres my final code to see what I'm doing. if anyone wants to test it just create a "STREETS.txt" file and put some lines in it for the code to call on. Code: [Select] TITLE Street Test Generator @echo off color f0 cls ECHO ============================================= ECHO Americus Fire and Emergency Services ECHO ============================================= ECHO ... ...... ...... ... ECHO MMM MMMMMM. MMMMMM MMI MM ECHO M. M. MM MM MM, ... ECHO M M. MMMMMM MMMMMM. MMMM . ECHO .MMMMMM. MM MM MO MM ECHO MM MN M. MM M. MMMMMM. MM .NMMMM MM. ECHO .. . .. . . . . . ECHO ============================================= ECHO Street Test Generator 1.0 ECHO ============================================= IF EXIST street_test.txt. (del street_test.txt.) set idx=0 for /f "tokens=* delims=" %%v in (STREETS.txt) do ( call set /a idx=%%idx%%+1 call set array.%%idx%%=%%v ) ECHO. Echo ==================================================== ECHO. :again set /p var=HELLO %username% !! Enter how many streets you need (max 40): IF %var% GTR 40 GOTO again set cnt=0 ECHO. ECHO ==================================================== ECHO. :loop call set /a cnt=%%cnt%%+1 set /a rnd=%RANDOM% %% %idx% + 1 call echo %%array.%rnd%%%>>street_test.txt call echo %%array.%rnd%%% if %cnt% LSS %var% goto loop ECHO. ECHO ==================================================== ECHO. Echo street_test.txt with %var% streets has been created. ECHO. ECHO ==================================================== ECHO. ECHO. pause |
|
| 5828. |
Solve : Need Help with Batch File!!? |
|
Answer» I have created an Ip/Id identifier for computers, to quickly get ip information etc. |
|
| 5829. |
Solve : Copy to mp3 player? |
|
Answer» Hi guys, I have an mp3 player and I'd LIKE to copy some files to my mp3 player. It is a normal mp3 player (not an iPod ) and it like an usb stick. The only problem is, in my computer I don't SEE a drive letter assigned to the player, but only a name (sansa bla bla mp3 player, it's a mp3 player from sandisk). What happens when you double click the name in My Computer? I know how to copy my files on my mp3 with the GUI in windows, but my question is rathor how to know the path to use the COPY command in a BATCH file.. Here is a screenshot of my My Computer: You will notice there is a '(E:)' NEXT to my Memory Stick Name. That would be the drive letter. Copying files to it should be something like this: Code: [Select]copy "C:\DOCUMENTS and settings\username\desktop\picture.jpg" "E:\picturefolder"This is mine: as you can see i don't have a drive letter, how can i access it?Interesting.....What happens if you double click it? the problem is your device is set to use MIP (multimedia interactive player) standard its set there by default, the new version of windows media player ,version 11 ALLOWS you to recognize MIP , but thats by default, look under the USB setting by default its Auto and set for MIP , there should be two or three MSC mode MIP mode and MTP mode play around with them till you see a drive letter Quote from: diablo416 on September 03, 2008, 07:37:41 AM
Thanks for the response, the solution was indeed configuring usb player to another modus, :-) Thanks for your help guys Nice one Diablo. |
|
| 5830. |
Solve : need help with adding a login to a batch file? |
|
Answer» hi i only started using batch files yesterday and i have written a program, at first i had a very primitive password protection on it; |
|
| 5831. |
Solve : How do i change the file names of a bunch of files...? |
|
Answer» I need HELP changing the file names of a bunch of FILES in my computer. I have files wherein the beginning of the file is DIFFERENT but the end is all of the same series. For example: Couldn't test this because CMD isn't working for some ****** unknown reason but let me know if this is correct: No it is not right. The >> characters are wrong, and should be replaced by a space. ok thanks |
|
| 5832. |
Solve : Need advice fast? |
|
Answer» One of my users is getting this MESSAGE: if you have a USB device you could probably write to that.... If it is formatted FAT and if the BIOS supports it. If the desired files are on an NTFS partition, then DOS will not see it without special software. Putting DOS on a pen drive and making it bootable is a handy thing to do. A biggish pendrive with BartPE is even better.Hi... I can not ping to any IPs. Even i tried with a pc directly connecting to my pc, still not. And, the PPOE connection too does not work but my dial up connection is working. pleaseee support me.Quote from: amunssif on September 02, 2008, 12:26:19 AM Hi...Please start a new topic.Chances are the HD was formated as a NTFS file system. DOS dos not read NTFS formated drives. You need to create a NTFS boot up disk to access the files on the HD. Or if you can boot the system in safe mode and try to copy the files to a floppy. But you are limited to only 1.3mb on a floppy. You can slpit the file if it is bigger then a single floppy can hold using multiple floppys.. Good luck |
|
| 5833. |
Solve : Batch to Run 3 Programs? |
|
Answer» So This?: You got it. Code: [Select]choice /m "What Is Your Choice?" /m must come after CHOICE to indicate that the passage in quotes is the displayed message according to my system ( Vista Home Premium ) It has CHANGED then. I have the Windows 98 choice.exe Code: [Select]CHOICE [/C[:]choices] [/N] [/S] [/T[:]c,nn] [text] This is Vista choice.exe option text Code: [Select]CHOICE [/C choices] [/N] [/CS] [/T timeout /D choice] [/M text]AH, yes WIn98 Choice command needs no /mHere is another way you can start your 3 programs @ECHO off cls :start ECHO. ECHO Y. Start Programs ECHO N. Exit set choice= set /p choice=Type Y or N to run programs or exit. if not '%choice%'=='' set choice=%choice:~0,1% if '%choice%'=='y' goto progrun if '%choice%'=='n' goto bye ECHO "%choice%" is not valid please try again ECHO. goto start :progrun start "" "C:\Program Files\Mioplanet Battery Meter\Mioplanet Battery Meter.exe" start "" "C:\Program Files\Pixoria\Konfabulator\YahooWidgets.exe" start "" "C:\Program Files\Stardock\ObjectDock\ObjectDock.exe" goto end :bye ECHO BYE goto end :endThat code works perfect also, but I have also edited the other code a bit. Code: [Select]@echo off title Macilizer echo Macilizer starting... ping -n 1 -w 2000 1.1.1.1 >nul echo Initializing... ping -n 1 -w 500 1.1.1.1 >nul Choice /M "Do You Want To Run Mac Look-Alike Programs?" If %errorlevel% EQU 2 goto no If %errorlevel% EQU 1 goto yes :yes echo Starting Battery Meter ping -n 1 -w 2000 1.1.1.1 >nul start "" "C:\Program Files\Mioplanet Battery Meter\Mioplanet Battery Meter.exe" echo Starting Konfablator ping -n 1 -w 2000 1.1.1.1 >nul start "" "C:\Program echo Starting Object Dock ping -n 1 -w 2000 1.1.1.1 >nul start "" "C:\Program Files\Stardock\ObjectDock\ObjectDock.exe" ping -n 1 -w 2000 1.1.1.1 >nul echo Exiting.... ping -n 1 -w 2000 1.1.1.1 >nul exit :no echo Exiting.... ping -n 1 -w 2000 1.1.1.1 >nul exit |
|
| 5834. |
Solve : run a program in a .bat file...read on? |
|
Answer» Ok, I want to make a .bat that runs Pinball. I have this... Ok, I want to make a .bat that runs Pinball. I have this... Wow, I might actually know this one... is the "C:\Documents and Settings\All Users\Start Menu\Programs\Games" in quotation marks?If you want to use the shortcut, the line should be: "C:\Documents and Settings\All Users\Start Menu\Programs\Games\Pinball.lnk" Note: that you left off the name of the shortcut: Pinball.lnk But, why not skip the start menu & shortcut all together. Go to Start, Programs, Games: Them Right CLICK on Pinball, Properties. The TARGET should be highlighted already. Right Click on the target name, Click Copy. Then paste the target into your batch file. In XP it will be: "C:\Program Files\Windows NT\Pinball\PINBALL.EXE". It could be different in other Installations. I usually skip the start COMMAND. I don't know why, but it seems to work better without it. Correction on 04/05/2008: Do not skip the start command when starting a program in a batch file. It does NOT work better without it. For more information see the following more recent topic with a similar problem & resolution. I need help again with a script file... ANYONE STILL UP TO HELP ME?? Ah, I know that looked a little wrong. Yeah, I think TARGETING the actual .exe in your program files should be better. I don't know if it will make much difference in this specific context, but if you happen to move or delete a shortcut but the program is still installed, it'll still give ya an error, whereas if it was linked to the program, it'd be fine. I'm always moving around the shortcuts on my desktop, and it would be a pain if I had to CHANGE my .bat file every time.It helps actually using the 'start' command because then the CMD window will close after the game opens up.Use the /B switch, And the command window won't open up at all. START /B DRIVE:\PROGRAM.XXXI'm not familiar with /B (I'm pretty much a neophyte myself...) what does that stand for? in what context can I use it?Try Start /? first. Then experiment. Trial and error is your best teacher. I spent about 10 hours on my last batch file, writing, reading help, testing, and debugging a little bit at a time.If all you are really trying to do is run pinball, why not just put a shortcut on the desktop? |
|
| 5835. |
Solve : dos copy cmd and long folder/filenames? |
|
Answer» in win xp at the command PROMPT I'm attempting to create a batch file that does this: copy "G:\FORMS\ken\LMC Smart Design\*.*" "C:\LMC Smart Design\*.*" You can LOSE the bit in red, not needed and may be stopping the command working. thanks for everyones help, this is what worked: Code: [Select]:begin cls cd F:\"Access Database\" copy "Premier Assets Management XP.mdb" C:\"Access Database\" start /max c:\"program files\microsoft office\office12\msaccess.exe c:\"access Database\Premier Assets Management XP.mdb" :end Dias de verano: Yes, I think you were right about removing the "\*.*" from the end of the command. That was part of the problem. The other part was I needed to copy subfolders so I changed the command to xcopy ENDING with /e and that worked like a charm. Thanks so much for putting me on the right TRACK. |
|
| 5836. |
Solve : how to set input parameter in batch? |
|
Answer» Hey all,
That sort of thing? No these are not parameters that would be called as arguments for the application. Maybe a good example would be the MySQL command line tool, where you ENTER a few parameters initially, but you can do multiple SQL statements within the tool itself. Here's another example: Code: [Select]C:\Users\***\Documents>consoleApp -u=username -p=password $>call method in consoleApp method was called $>obtain network rights rights obtained The lines where I obtain network rights or call method in consoleApp wouldn't be called as arguments to the application, but would be interaction the USER takes typically after the application is running.OK I'm with you. Like telnet, where you open a console? there is no generic way of doing this. You could try a pipe which works with some programs but not others echo command1 > myfile.txt echo command2 >> myfile.txt echo command3 >> myfile.txt echo quit >> myfile.txt type myfile.txt | consoleApp -u=username -p=password Something like that, although I have a feeling that the username and password stuff might get in the way, but you could experiment. |
|
| 5837. |
Solve : bat file IF statement need help? |
|
Answer» Hi, Thanks that works great. But what about if I need to check for string in any position in the file name. Example: Find if "abc" is a part of the all file names in the current directory. OS Windows XP can I do something like: setlocal enabledelayedexpansion FOR /f %%F (*.*) do ( set filename=%%F IF filename condition "abc" command What will be the condition if it Thanks..You can use && and || operators [Operation] && [do this if operation was successful] [Operation] || [do this if command was not successful] Do something if abc IS found... use >nul to stop echo to screen Quote
or if you have more than 1 command to execute... This is the general way to execute more than 1 command after a TEST Don't forget to count parentheses (( )) Quote
Do something if abc IS NOT found... Quote
or if you have more than 1 command to execute... Quote
Of course you can do this instead of having the sought string in the test itself Quote
|
|
| 5838. |
Solve : Running Virus Scan in MS Word!? |
|
Answer» HI, i tried searching for answers but no luck. i noticed for about 4-5 months now EVERY time i OPEN a word DOCUMENT in MS word 2003 it takes a long time to come up! and at the bottom left it displays a text "running virus SCAN" is there a way to turn this off? i have only one anti-virus software installed "NOD32" but i had this anti virus software installed for more than two years now. i have another computer at HOME but don't have this situation. Than in advance. |
|
| 5839. |
Solve : need help on notepad/batch? |
|
Answer» so i was wondering if there was a way to open note pad and it will aready have so i was wondering if there was a way to open note pad and it will aready have 1.) Make a text file, containing that one LINE @echo off. Name it temp.txt 2.) At the command line, type notepad temp.txt and Notepad with start, with that file opened. 3.) ADD whatever text you want. 4.) SAVE with Save As , not Save Btw, if you are doing MUCH work at the command line, instead of fooling around with the Windows editor, i.e. Notepad , why not just use Edit ? That way you are not having to flip back and forth with windows. |
|
| 5840. |
Solve : how to add with batch file??? |
|
Answer» the title says it allI don't get it...ADD what to where from where??? More details lollike how do u add 1 and 1 or 200 and 20oh lol, then you could use the set command like the following: |
|
| 5841. |
Solve : Export directory contents? |
|
Answer» Hi, |
|
| 5842. |
Solve : '|' in cmd? |
|
Answer» Is it possible to put 'an '|' in COMMAND prompt. @echo offDoesn't WORK, it says syntax error or something. Anyone know how to do it? Thanks in advanceyes , just put ^ before | eg echo ^|OH sweet, thanks Ghostdog |
|
| 5843. |
Solve : My computer died!! HELP!? |
|
Answer» Hello, I was playing a game yestoday night. And when I was playing my computer frooze so I shut the computer down by the electric. And now when I try too start the computer it wont load. I got a blue botton I press when the computer gonna start that blue botton is blinking(it blinks like that when the computer is in sleep MODE) and the start botton for my screen goes orange (it goes orange when its in sleep mode too) and the screen is just BLACK.. |
|
| 5844. |
Solve : Text to speech program.? |
|
Answer» Dear All ! |
|
| 5845. |
Solve : cmd.exe not functional? |
|
Answer» The cmd.exe in my pc is not functioning. Every time I enter a valid dos prompt and press enter, the next line will show (name of the command) is not recognezed as an internal or external command, operable program or batch file. I cannot recall if anything has been changed before that. The cmd.exe in my pc is not functioning. Every time I enter a valid dos prompt and press enter, the next line will show (name of the command) is not recognezed as an internal or external command, operable program or batch file. I cannot recall if anything has been changed before that. Even with something LIKE dir ? Try that, post back .... what happened? Next, try path , then hit enter. What happened? Post back here what appears on screen. Sorry. Some of the commands such as dir , path, are ok. But some are not functional. Below are some examples copied for the cmd dos page: Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp. C:\Documents and Settings\Hauw.COMPUTER>path PATH=Path=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem C:\Documents and Settings\Hauw.COMPUTER>dir Volume in DRIVE C has no label. Volume Serial Number is 44B8-45B7 DIRECTORY of C:\Documents and Settings\Hauw.COMPUTER 07/15/2006 06:28 PM . 07/15/2006 06:28 PM .. 12/24/2006 05:13 PM .housecall6.6 07/15/2006 06:06 PM Start Menu 07/16/2006 09:44 PM My Documents 07/16/2006 09:44 PM Favorites 07/15/2006 06:06 PM Desktop 03/15/2007 12:02 AM 4,456,448 ntuser.dat 07/30/2006 12:27 AM Contacts 01/23/2007 09:54 PM boran-remover 02/25/2007 05:17 PM 0 getservice.txt 2 File(s) 4,456,448 BYTES 9 Dir(s) 2,679,857,152 bytes free C:\Documents and Settings\Hauw.COMPUTER>ipconfig 'ipconfig' is not recognized as an internal or external command, operable program or batch file. C:\Documents and Settings\Hauw.COMPUTER>ping 127.1.1.0 'ping' is not recognized as an internal or external command, operable program or batch file. C:\Documents and Settings\Hauw.COMPUTER>help 'help' is not recognized as an internal or external command, operable program or batch file. C:\Documents and Settings\Hauw.COMPUTER>cd..\ C:\Documents and Settings>cd.. C:\> Any clue? HenryHauwQuote
Use the Search within WinXP... MAYBE it is called Find . Search all your hard drives when you search. Have it look for ipconfig . If and when it finds it, note the directory. Same for ping . Now compare those directories to those listed in your path. See them there, as the result of your Path command? They are seperated by semi-colons. When you execute a command, 'dos' first looks in the current directory for it. If not found, 'dos' then searchs the directories listed in the path variable. If it finds it, it runs it. If not, it reports back to you that the command was not found - which is what you are seeing. In other words, something like ping must be in the path, or you must be in the same directory with it to run it. I don't know about WinXP, but I would expect to find ping.exe in C:\Windows . According to your report, that directory is in your path. So, ping should run..... if it exists there. So I'm wondering why it is not there. We'll find out if it exists, and where, when you search all your hard drives for it. I think both Ping and Ipconfig are normally in the C:\WINDOWS\System32\ folder.I have run search. My ping, ipconfig and help are in several directories. One of them is C:\windows\system32. After I copied them to C:\windows, they run ok. I wonder why they were missing from C:\windows folder and how many more commands have been affected. Anyway, Many thanks. Henryhauw |
|
| 5846. |
Solve : rename directory with date? |
|
Answer» If I want to rename a directory name that changes every week, how can I do that? I have tried just about every combination of masks and wildcards I can think of. It has got to be a lot easier than I am making it. If I want to rename a directory name that changes every week, how can I do that? I have tried just about every combination of masks and wildcards I can think of. It has got to be a lot easier than I am making it. This doesn't work for you: ren ??07 show I just tried it, and it WORKS for me. What version of 'dos' are you using? Also tried move *07 show and that worked too. If you need to get that date into an environment variable, so you can specify the exact DIR name - you can do that with a free utility program, Fdate. See: http://www.ferg.org/fdate If you are using WinXP, you can get the date into an environment variable without Fdate, but since I don't use XP I won't attempt to explain that - you can probably find it explained here in these forums though. It comes up every now and then. Fdate is well documented. Along with plenty of examples. It does a LOT more than just get the date too. If you get the hang of it, you find it is a very handy tool to have. And the price is right. I hope this helps. Hi, Thanks for the response. The problem with the ren and "?" filemask is that the composition of the date structure changes. It could be a single digit month or a double digit. Additionally, the ren command did not work for me. I did find the "move" command. It works perfectly, although I had to run two of them in the batchfile to accomodate for the additional character in the date (like 12-07-07). It works now. Quote
As far as ren not working - you forgot to answer the question about which version of "dos" you are using. Honestly, I was surprised it worked here. Using Win98SE. Only reason I tried it was because you mentioned it. In my mind, the way to rename directories was with the move command. That could be something left over from many years ago with plain old MS-DOS - - not sure now. Quote I did find the "move" command. It works perfectly, although I had to run two of them in the batchfile to accomodate for the additional character in the date (like 12-07-07). Sounds like you are using the ? , not the * . The question mark is for one character, the asterisk is for all characters. Quote It works now. And this is the bottom line. Glad you got it going - one way or another. Thanks for posting back. I think your dating yourself, as I am. I miss my C:> prompt. It was so cold and impersonal. * God Bless Bill Gates* As for the DOS version, sorry. It is whatever comes with XP Home. I tried it numerous times with the filemask variables. I could only do it when I specifically used the complete directory name. Anyway, as you stated, it works. Could be the reason I was kicked out of my Pascal and Cobol classes. I am not, and do not ever want to be, a programmer. Quick and dirty is my theory. I flunked one class project - it was some simple manipulation of database problem. It took me over 300 lines of code to do it. The answer was only 30 lines. But mine worked too and it had color graphic responses. (I love the IF THEN ELSE statement.) Thanks again.Quote I think your dating yourself, as I am. I miss my C:> prompt. It was so cold and impersonal. Yes, I probably am dating myself. But that C: prompt worked! without a lot of complicated extraneous stuff. Quote * God Bless Bill Gates* Stay away from www.linuxquestions.org forums with that. Quote As for the DOS version, sorry. It is whatever comes with XP Home. I don't have XP, so based on what you say and what I just tried on Win98, there must be something different about how their respective command interpreters handle it. Quote Anyway, as you stated, it works. Could be the reason I was kicked out of my Pascal and Cobol classes. I am not, and do not ever want to be, a programmer. Quick and dirty is my theory. Get yourself a copy of Fdate. The first time through, it might take you a few minutes to configure. It has a LOT of options is all. But after that, you might find yourself like me - I keep it (and a few other handy programs) in a 'utils' directory in my path. Quote I flunked one class project - it was some simple manipulation of database problem. It took me over 300 lines of code to do it. The answer was only 30 lines. np. Glad you got it. And I hope that you don't have to run it twice now, if you've tried using the asterisk with move , instead of question marks. Sorry Sir, Another question If I want to rename a file name to today's date ex: ren show "today's date" How can I use the command. tks. Quote
For your future benefit, KNOW that it is best to start a new thread with your question. That way it gets NOTICED, and your question gets the attention it deserves. It is also less confusing as others come along and read the current thread. Since your question is easy to answer, here you go: 1.) It can be done, using the command line, under WinXP. I don't have WinXP, so don't feel comfortable trying to talk you through it. You can search the forums here, as it has come up before, and you will likely find the answer. 2.) The way I do it works under not only WindowsXP, but older versions of MS-DOS, and the 'dos' that comes with older versions of Windows. Go here: http://www.ferg.org/fdate/index.html and download a free utility program. It does a LOT more too. To answer your SPECIFIC question, go here: http://www.ferg.org/fdate/index.html#faqs The first example given in that FAQ is exactly your question, answered. I hope that helps. |
|
| 5847. |
Solve : Looking up IP add through Yahoo Messanger/webcam/? |
|
Answer» hey i have been told that you can find out the person you are speaking to/viewing cam/yahoo messanger/etc by doing something on DOS to figure whose your COMPUTER is connectted to. Is there any TRUTH to this?You can type netstat in command prompt and you would have to look for it...may i ASK why you need their IP address?where would you like to know that? |
|
| 5848. |
Solve : How can I run a DOS program in custom size window?? |
|
Answer» Quote No - not "pulling" anything. You wrote that you copied it, and I read what you wrote. It seems that I did understand it correctly too. Err... I think we're going off track here? I don't think this comment was in any way relevant to the problem & I don't wish to sidetrack into a completely different debate simply because the original posting is perhaps becoming EXHAUSTING for you (exhausting as in boring before you "pull" me on that). Quote That wasted a lot of TIME and posts. Again, pointless comment & incorrect. In what way have I wasted time & post's by simply abbreviating a set of words? If I describe something as 'crap' but it's called 'crappycrapcrap' how does that waste time or affect you? your not the one using the words to achieve something are you? I am. Quote Ok - if you've got the Command Line entry so that it points to the batch file that launches your game, and you've got the WORKING entry so that it points to the directory where your game resides, then that is what you need to do. Oh dear, this relationship is going down the PAN isn't it? You would have 'ascertained' this much sooner, if you'd read my PREVIOUS post's, and 'looking for the error'? I thought I'd been doing that all along! Quote Perhaps 2K_dummy has been following along and will have some advice. Yes, I hope so... |
|
| 5849. |
Solve : cant change directories on ntfs4dos boot disk? |
|
Answer» Im TRYING to execute diskpart.exe USING ntfs4dos. When I boot the computer with the floppy it wont let me change DIRECTORIES from the a prompt. I can type in CD c and it will change to c but then changes right back to a. I can also do dir command and it will show all the files in the dir but it wont let me change from a prompt.Welcome to the CH forums. What are you trying to do? CD C means "Change to Directory C on the current drive" do you have a directory named C on the floppy? If you want to change to DRIVE C: you must enter C: WITHOUT CD. Good luck. haha thanks for helping a total newb |
|
| 5850. |
Solve : Re: Unique sort using MSDOS? |
|
Answer» Quote How can I use MSDOS to sort a file unique ? Can you EXPLAIN a bit? not sure what you are asking for.Looks as if the original message was deleted. However I'd ASSUME BASED off what was in the quote that maybe they were wanting a sort by file type. For example listing only executable files ( dir *.exe ). But that's just a guess. Since user deleted message may really NEVER know. |
|