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.
| 5451. |
Solve : Determining the base path from random computers in removable media? |
|
Answer» Now here is a challenge for the masses, though any help is appreciated. While the attempts at help are appreciated, it doesn't appear to be true. I have tested it for the USB with a different name, different letter, different name and letter, and multiple letter types. The drive letter changed every time. I disagree. I have 4 different flash drives...different brands and no matter where i plug them in, no matter what customer's machine, they retain the drive designation i gave them.Quote from: patio I disagree. I am not saying that it doesn't work for you, Patio. I'm saying that it doesn't work on the computers and flash drives I am using. What I am wondering, though, is what kind of partition you have on them. The only formatting I didn't have at the time was NTFS, which might be a possible reason, however unlikely. Another thought that has occurred to me after the fact is that I was referring to the drive letters themselves. So if you were referring to the drive name in specific, then yes, it is retained. Otherwise, no. Sidewinder: It isn't exactly what I was after, to be honest, but it does appear to be working for my purposes. Thank you.Drive letters and Volume labels are retained no matter what file system i use. There is no reason to format flash memory anything but FAT32 but one i keep FAT16 for older systems. Perhaps this hasn't worked in your case because you re-named the drives instead of preparing them as i said. I do the above steps after a full format and it's never failed me. Maybe this is not the case if you just rename / designate a drive letter on a previously designated drive...Quote from: patio I do the above steps after a full format and it's never failed me. Maybe this is not the case if you just rename / designate a drive letter on a previously designated drive... Simply put, yes. I was in the process of fieldwork when I was experimenting, and had no place (or at least, not enough time) to unload, format, and re-copy the drive materials. (That, and I still use the nearly-full 30 GB iPod for its actual purpose, as well as storage space.) In any event, the effort is appreciated, and I will keep it in mind for the future.Any problems so far mixing data files and tunes on the 30G iPod ? ? Been thinkin about grabbing one...(Sorry about taking so long to reply...) If you haven't gotten one already, there hasn't been a problem yet. It appears that the programming is closed-table software, and doesn't recognize anything it doesn't specifically create, save notating an "other" on the drive space. |
|
| 5452. |
Solve : Complicated .bat Help? |
|
Answer» Hello All. |
|
| 5453. |
Solve : FTP: using ls to write a directory listing locally? |
|
Answer» NOT SURE if I'm in the correct forum.. but here goes.... I am connecting to a SECURE FTP site daily to SEND a file to a Vendor. Here is my script: open ip.address.of.vendor usernamepassword cd uploads put D:\folder\myfolder\*.csv quit this works perfect!!! what I am trying to do is add the LS command to write a remote directory listing locally. This is the only way I can think of to actually check to see if my file was successfully transmitted. I just want to add an ls command after my put command and PULL a directory listing back to my local machine.. can anyone help with the syntax??? Dunno if this helps I think you use dir in the local DOS ftp PROGRAM to cause an ls on the remote Unix machine to be written locally. On this page http://rotterdam.ics.uci.edu/info/DosFtp.htm it says Quote Using FTP in MS-DOS:I don't know of a way to do what you want in one step. I think you have to do it in 2 steps. For example, if your current batch is called UPLOADFILES.BAT and your FTP command file is called UPLOADFILES.FTP, you can make a new command file named LISTFILES.FTP like this: UPLOADFILES.BAT Code: [Select]ftp -s:uploadfiles.ftp ftp -v -s:listfiles.ftp >filelist.txt LISTFILES.FTP Code: [Select]open ip.address.of.vendor username password cd uploads ls quit Then you can parse your FILELIST.TXT Thanks GuruGary. That is what I was looking for! I get back a directory listing from the remote end written to a .txt file - I don't get a date/time stamp on the file, but the filename contains the current date, so that should be good enough. Thank you for your help!If you want the timestamps, try replacing the "ls" command in the LISTFILES.FTP with "dir". |
|
| 5454. |
Solve : How to Mass-close programs and Killing Processes? |
|
Answer» How would I go about writing a line of code to mass close all programs open And Gary, I just read one of your other posts, for someone who likes to help you are sure are quick to condemn people of using batch code for ill-mannered things. Sorry, but I've been taken advantage of before and I like to help people for positive reasons, but not negative. So I feel it is my responsibility to do what I can to reduce the possibility of my code being used for the dark side. Under XP Pro, you can list the tasks with the TASKLIST command. You can either use the TASKLIST /FI to look for certain tasks or you can search for your items with a FOR /F loop. Then when you find the ones you want to kill use TASKKILL. Something like Code: [Select]for /f "delims=1" %%a in ('tasklist') do ( if /i {%%a}=={notepad.exe} taskkill %%a if /i {%%a}=={whatever.exe} taskkill %%a ) |
|
| 5455. |
Solve : need help renaming files with batch program? |
|
Answer» ok i KNOW how to label things like: |
|
| 5456. |
Solve : Replacing the exe? |
|
Answer» Hi I very new to this but I need a script that replaces a file it while displaying a text saying that it is replacing the file You need to provide more details. What is the name and path of the file you want to replace? And what is the location of the file that will be replace it? And what OS are you running? |
|
| 5457. |
Solve : Copy from subdirectories.? |
|
Answer» Hi All!! Thanks !it's working perfectly. You edited your POST while I was answering the questions. 1. It is common practice in laying out code to indent structures such as loops, blocks, etc. This makes such elements of structure clearer. It is purely a matter of preference. It helps to SEE that you have matching numbers of start and finish structure statements, ESPECIALLY when structures are nested. EG in BASIC, but also in many other situations. Code: [Select] FOR J = 1 to 10 PRINT J PRINT J+6 NEXT J IF X=10 THEN PRINT X END IF IF A>10 THEN IF B = 6 THEN FOR X = B TO A PRINT X NEXT X END IF END IF 2. "delims==" tells FOR that the token delimiters are the BEGINNING and end of the each line (IE do not slice at spaces, commas, etc) "delims=," would result in dissection of lines at commas. Thanks for making easiest. Thanks, Jay |
|
| 5458. |
Solve : is there any Dos comand for getting details system Properties????? |
|
Answer» Hi, I am using Windows XP Professional , is there any Dos comand for getting DETAILS system Properties?HEYA ..YES there is .. but why wuld you wanna do that? Hi, I am using Windows XP Professional , is there any Dos comand for getting details system Properties?c:\>systeminfo |
|
| 5459. |
Solve : copy new version of applicatrion on all clients where older version already exis? |
|
Answer» i would like to copy one *.exe file( which is new version) from one system to many |
|
| 5460. |
Solve : ren help? |
|
Answer» my files Or just do: This is fine for the files in (your folder), but not any of the other folders in the example. My solution will rename all files named "setup.exe" in all directories on the drive and all subdirectories, sub-subdirectories, etc. If that is not what you want please be more specific so we can GIVE a better solution.it's work, tq erm.... can i rename the same size *.exe files? M:\setup.exe [5mb] M:\1\setup.exe [5mb] M:\2\setup.exe [3mb] M:\3\setup.exe [5mb] M:\4\setup.exe [4mb] * can i rename the *exe file if there are same size in "BATCH"? Quote from: insertusername on May 11, 2007, 04:08:04 AM it's work, tq Yes.erm... i mean i want it auto rename when the *exe file size is same. how to write in batch?Same size as what?Quote from: GuruGary on May 11, 2007, 09:09:32 AM Same size as what? I was wondering thatis same size on disk. how i write a .bat to rename .exe file if they are same size on disk? Quote from: insertusername on May 14, 2007, 01:29:18 AM is same size on disk. This is like pulling teeth. Please state as fully as POSSIBLE what you want to do! Maybe try PROVIDING us with a flow chart, or write the program using words instead of code. Something like: Quote Search the entire C: drive for files named setup.exe... or whatever you want to do.Is this section of the forum (1) A free batch file writing service for lazy numpties -or- (2) A place where people who are trying to write batch files get helpful hints and pointers? (ideally by providing a FIRST effort to be looked at and commented upon) I very much want it to be (2). Yes, (2) would be much better.(1) A free batch file writing service for lazy numpties i DISLIKE this word! "lazy numpties", nvm i will learn with myself. guru tq |
|
| 5461. |
Solve : regedit shortcut? |
|
Answer» i want to access mysql via start menu so i did following Try changing: it is ok thanx ..... U r perfect That is one cluttered context menu you've got there.You're welcome. Quote from: CBMatt on May 31, 2007, 02:33:50 AM That is one cluttered context menu you've got there.And you do have a lot of items in your top level menu. You may want to look into the "QUICK Launch" bar or something that is better suited for a larger number of items. |
|
| 5462. |
Solve : how do i close a open file? |
|
Answer» I did master GameMaker and thats not fully what i wanted. I did master GameMaker and thats not fully what i wanted. What's the msg thing for? The batch help file for it says: Quote Send a message to a user.You talk about GM movement code in one sentence, then you talk about a batch pop-up thing the next. I don't really get it. ANYWAY, does anyone know a batch code for when buttons are pressed?i know one that you have to do enter at the end but i DIDNT want to use cause pressing enter is anoying i used it to make text based games. Code: [Select]set choice= set /p choice=what do you do next? if not '%choice%'==' set choice=%choice:~0,1% if '%choice%'=='1' goto oneif you remove if '%choice%'=='1' goto one you have a code that when you enter something it saves it and also you have to make the one next to the 0 15. so its lik this Code: [Select]set /p choice=what do you do next? if not '%choice%'==' set choice=%choice:~0,1% o yeah theres a serius flaw in gml it makes the games slower... gm needs every thing to run d an d so it takes a while to change the code |
|
| 5463. |
Solve : Create backup to a network drive? |
|
Answer» Hello people, |
|
| 5464. |
Solve : tasklist question???? |
|
Answer» Dear my fren You can parse the output of TASKLIST with the FINDSTR command, and if you don't find the program you are looking for, just launch it with the proper command or by using the START command. ermmmm dont really understand what you actually want me to do sry my english is bad cant understand can you SAID it in more simple wayThere is a program called Tasklist. Tasklist makes a list of the tasks. A batch can look at the list and see if a task is running. If it not running it can start the program. Gary, LIKE you, apparently, I am getting bored with being a "batch writing service" for people who aren't interested in the code at all, they just want to fix something at work or get their homework done. Quote from: contrex on May 30, 2007, 11:40:58 PM There is a program called Tasklist. thx alot finally i made itQuote from: contrex on May 30, 2007, 11:40:58 PM Gary, like you, apparently, I am getting bored with being a "batch writing service" for people who aren't interested in the code at all, they just want to fix something at work or get their homework done.Yes. And helping some people makes me nervous, especially when they want to close programs, end tasks, delete files and eject CD-ROM drives.Quote from: GuruGary on May 31, 2007, 12:00:02 AM Quote from: contrex on May 30, 2007, 11:40:58 PMGary, like you, apparently, I am getting bored with being a "batch writing service" for people who aren't interested in the code at all, they just want to fix something at work or get their homework done.Yes. And helping some people makes me nervous, especially when they want to close programs, end tasks, delete files and eject CD-ROM drives. well anyway thank alot i just forgot the tasklist command |
|
| 5465. |
Solve : Change directory dynamically and start application, using Loop? |
|
Answer» Hi i'm NEW here. cd "C:\TESTING\CROP - 001" portion of my code here: Code: [Select]for /L %%x in (1,1,10) do ( IF %%x LSS 10 Set curInstancePath="C:\TESTING\CROP - 00%%x" IF %%x GTR 9 Set curInstancePath="C:\TESTING\CROP - 0%%x" echo %curInstancePath% cd %curInstancePath% start testing.exe ) For this, echo %curInstancePath%, why i always get the value "C:\TESTING\CROP - 010"? Pls advice..really appreciate your helps..Code: [Select]REM PUT THIS AT START OF BATCH setlocal enableextensions enabledelayedexpansion for /L %%x in (1,1,10) do ( if %%x LSS 10 Set curInstancePath="C:\TESTING\CROP - 00%%x" if %%x GTR 9 Set curInstancePath="C:\TESTING\CROP - 0%%x" REM In loop must use delayed expansion to read env variables REM because otherwise they are expanded before loop is run REM use !VARNAME! instead of %varname% echo !curInstancePath! cd !curInstancePath! start testing.exe ) thanks alot Contrex. but i face another problem.. cd !curInstancePath! is not working i check the current directory by using echo %cd% i couldn't see any changes of directory. once again..thanks for your helps..Do those directories already exist?Quote from: sayhigh on May 30, 2007, 07:55:40 PM thanks alot Contrex. is curInstancePath taking the right value each time? yes..it get the right value each time.. i've solved it by add C: for /L %%x in (%curInstance%,1,%curMaxInstance%) do ( IF %%x LSS 10 Set curInstancePath="C:\Stress Tester\CROP - 00%%x" IF %%x GTR 9 Set curInstancePath="C:\Stress Tester\CROP - 0%%x" cd !curInstancePath! C: ) thanks alot..Oh I see you are not logged in on C: You can do the same thing another way by adding the /D switch to the CD command. Code: [Select]cd /D !curInstancePath! Code: [Select]F:\>cd c:\batch F:\> F:\>cd /D c:\batch C:\batch> sorry..previously i forget to mention i run the bat file in D drive.. yeah..thanks alot man.. |
|
| 5466. |
Solve : Question on SHIFT? |
|
Answer» Hi, C:\>foo.bat This is a test for the Shift command Parameters are what you type in after the command. %1 is the first parameter, %2 is the second, parameter, etc.. So when you first RUN the command with "This is a test for the Shift command", then: %1="This", %2="is" %3="a", %4="test" ... Each time you execute the "shift" command from within the batch file, the parameters shift down one number. So after the first shift command it is: %1="is" %2="a", %3="test". Is that more clear now?Thanks for the example, its works now. But can the SHIFT function function within a single batch file alone? Can the parameters be obtained from a text file instead of keying them in cmd prompt? Possible to give another example? Thanks =)You could have one batch file call another. For example, if we keep our original batch file as foo.bat, we could have test.bat with the following code: Code: [Select]@echo off echo Testing the SHIFT command call foo.bat This is another test for the shift command That way you have not provided any parameters, but the Shift command is still used. Is that what you were asking?Yup, more or less like this. That mean the baseline is it only can work only when 2 bat files are used? My initial THOUGHT is actually by reading the parameters from a text file when the .bat file run and auto asign each parameter into %1, %2, %3, ... Thanks for your time! |
|
| 5467. |
Solve : Batch script question: closing non-DOS windows? |
|
Answer» Hi, |
|
| 5468. |
Solve : New to DOS have a quick qustion? |
|
Answer» I am trying to copy all extentions of *.dat* and have them moved to a new directory within a parent folder. I am also trying at the same time to let the user decide what the name of the directory will be for those files to MOVE into. .. Its fo a batch FILE but UNSURE how to do this or if this can be done. Any suggestions? |
|
| 5469. |
Solve : Help needed using wildcards with the copy command.? |
|
Answer» I'm trying to copy two files from two seperate UNC's to a single directory on a single server, appending the source server name to each file to AVOID duplicate file names at the destination. I'm trying to copy two files from two seperate UNC's to a single directory on a single server, appending the source server name to each file to avoid duplicate file names at the destination.Are there just 2 files, or 2 SETS of files? And what OS are you RUNNING? If 2 files, you can do something like: ::copylogs.cmd Code: [Select]copy "\\server1\c$\data\server.log" "\\DestServer\c$\logs\server1_server.log" copy "\\server2\c$\data\server.log" "\\DestServer\c$\logs\server2_server.log" If it is 2 sets of files, then depending on your OS, you can probably accomplish your TASK with a FOR /F loop for each set. |
|
| 5470. |
Solve : enable & disable taskmanager,regedit? |
|
Answer» how to write in ".BAT" to Please check his previous posts before assisting this clown.Right....YES...I see...my computer been inflected by virus svichosst.exe it disable my taskmanager and folder options i alredy CLEAN the virus. but the problem is my task manager still been block, i cannot right click my start bar to open it. so please help me. i using sp2Perhaps a legal version of Windows will help rectify your situation. |
|
| 5471. |
Solve : how to compare date time?? |
|
Answer» Hi Senior/Guru, |
|
| 5472. |
Solve : store the file path into a variable? |
|
Answer» @ECHO off |
|
| 5473. |
Solve : File path.? |
|
Answer» Hi Everybody!! Paste in another PC?copy-pastepaste what? the file? the name of the file?File. How you do this? network? MAGIC? hey! funny!!!! network, Sure will do! Quote from: Jayanand on May 13, 2007, 04:50:05 AM hey! funny!!!!you have to have some KIND of file transfer, like FTP. |
|
| 5474. |
Solve : Spaces in directory names? |
|
Answer» I'm new to programming, and I require assistance with a minor problem. Note that if you are in a batch file, use shutdown.exe instead of shutdown. Using the .exe extension is optional, whether an executable is in the current folder, or on the PATH. The only reason to explicitly add the extension would be if you had a different executable eg shutdown.com shoutdown.bat or shutdown.cmd in either of those places. (Bad practice!) If shutdown.exe is where it should be, ie C:\WINDOWS\system32, then shutdown or shutdown.exe will find it. Or am I missing something? Code: [Select]c:\>shutdown /? USAGE: shutdown [-i | -l | -s | -r | -a] [-f] [-m \\computername] [-t xx] [-c "comment"] [-d up:xx:yy] No args Display this message (same as -?) -i Display GUI interface, must be the first option -l Log off (cannot be used with -m option) -s Shutdown the computer -r Shutdown and restart the computer -a Abort a system shutdown -m \\computername Remote computer to shutdown/restart/abort -t xx Set timeout for shutdown to xx seconds -c "comment" Shutdown comment (maximum of 127 characters) -f Forces running applications to close without warning -d [u][p]:xx:yy The reason code for the shutdown u is the user code p is a planned shutdown code xx is the major reason code (positive integer less than 256) yy is the minor reason code (positive integer less than 65536) c:\>shutdown.exe /? Usage: shutdown.exe [-i | -l | -s | -r | -a] [-f] [-m \\computername] [-t xx] [-c "comment"] [-d up:xx:yy] No args Display this message (same as -?) -i Display GUI interface, must be the first option -l Log off (cannot be used with -m option) -s Shutdown the computer -r Shutdown and restart the computer -a Abort a system shutdown -m \\computername Remote computer to shutdown/restart/abort -t xx Set timeout for shutdown to xx seconds -c "comment" Shutdown comment (maximum of 127 characters) -f Forces running applications to close without warning -d [u][p]:xx:yy The reason code for the shutdown u is the user code p is a planned shutdown code xx is the major reason code (positive integer less than 256) yy is the minor reason code (positive integer less than 65536) c:\>echo shutdown /? > ss.bat c:\>echo shutdown.exe /? >> ss.bat c:\>ss c:\>shutdown /? Usage: shutdown [-i | -l | -s | -r | -a] [-f] [-m \\computername] [-t xx] [-c "comment"] [-d up:xx:yy] No args Display this message (same as -?) -i Display GUI interface, must be the first option -l Log off (cannot be used with -m option) -s Shutdown the computer -r Shutdown and restart the computer -a Abort a system shutdown -m \\computername Remote computer to shutdown/restart/abort -t xx Set timeout for shutdown to xx seconds -c "comment" Shutdown comment (maximum of 127 characters) -f Forces running applications to close without warning -d [u][p]:xx:yy The reason code for the shutdown u is the user code p is a planned shutdown code xx is the major reason code (positive integer less than 256) yy is the minor reason code (positive integer less than 65536) c:\>shutdown.exe /? Usage: shutdown.exe [-i | -l | -s | -r | -a] [-f] [-m \\computername] [-t xx] [-c "comment"] [-d up:xx:yy] No args Display this message (same as -?) -i Display GUI interface, must be the first option -l Log off (cannot be used with -m option) -s Shutdown the computer -r Shutdown and restart the computer -a Abort a system shutdown -m \\computername Remote computer to shutdown/restart/abort -t xx Set timeout for shutdown to xx seconds -c "comment" Shutdown comment (maximum of 127 characters) -f Forces running applications to close without warning -d [u][p]:xx:yy The reason code for the shutdown u is the user code p is a planned shutdown code xx is the major reason code (positive integer less than 256) yy is the minor reason code (positive integer less than 65536) c:\> c:\> Oh, my mistake. I thought I read somewhere that you had to run shutdown as a program in batch files, because you can't use the shutdown command in batch. But I guess I must've read wrong.Thanks a lot you guys, you've been a mountain of help. Now I just need to know one thing (I know I'm probably getting annoying now) But what would I need to input to tell it OPEN a browser on a certain website?"C:\Program Files\Internet Explorer\IEXPLORE.EXE" "http://www/google.com" Quote from: Millenion on May 29, 2007, 02:09:08 PM Thanks a lot you guys, you've been a mountain of help.you can just do Code: [Select]c:\> start "www.google.com" Actually, you wouldn't need the quotes because all websites are one WORD (they use underscores for spaces). So, Code: [Select]start www.google.com |
|
| 5475. |
Solve : How to refocus for the DOS command window? |
|
Answer» Hi All, |
|
| 5476. |
Solve : Installing DOS on a blank drive? |
|
Answer» I had a problem with my i386 the other DAY which required me to format the machine. However, I did so without foresight. When I boot my computer, it says, "Non-System Disk or Disk Error. Replace and press any key when ready." This is in reference to my C drive. I have the full set of DOS 4.01 and Windows 3.1 installation floppies, but my computer won't look at them. Can anyone help me to reinstall DOS? Diskette configuration error on drive A.F1 leads to another error, while f2 leads to the BIOS setup. Can you tell me how I can set the boot ORDER in my BIOS without disabling other disks?ESDI BIOS??? That's an IBM PS/2 unless I'm mistaken. You may need to boot from a Reference Diskette to set the CMOS it is a PS/2. Do you have a model number? Although I said it was an Intel on my previous post, it's actually a Chips and Technologies NW386SX-C, if that means anything to you. It says it's a CHIPS SCATsx/PEAKsx v. 105, and uses Parcorp, Inc's ESDI BIOS. Basically, I need help installing DOS on top of nothing but the BIOS when I can't get it to even see a floppy disk. Any ideas, anyone?How did you do the format ? ? With a blank HDD you will get this error with no floppy in the drive on boot. Insert Disk 1 of DOS and re-boot. |
|
| 5477. |
Solve : NEED HELP ?? FOR CREATING A MS-DOS BATCH FILE !!!!? |
|
Answer» If they just LOOKED at the title of the Command LINE Inerpreter that they are using, they would see if it is Command PROMPT or not.They don't unfortunately.You mean like this? |
|
| 5478. |
Solve : use mouse instead of light pen? |
|
Answer» Hello everyone |
|
| 5479. |
Solve : random command? |
|
Answer» is there a way to make a random word from a list appear? like if i type a list of random nouns and then random VERBS, and a sentance with blanks where the words should go, i could FUNNY stuff lolz.You could do something with this: @echo off What'ya think gamerx365? DOS IT HELP? that one definetly works right. i am still working on figuring out how to make it so that I can make more than one random sentence but so that it has different words.If I understand what you mean, you just have to change this Code: [Select]@echo off set "list1=dude,programmer,geek,squarehead,cookie monster" set "list2=eat,hug,destroy,unpimp,crack,hack,hammer" [b]set "list3=one,two,three,four,five"[/b] call:rndselect a "%list1%" call:rndselect b "%list2%" [b]call:rndselect c "%list3%"[/b] echo.The %a% is going to %b% that server. LOL! [b]echo. %c%[/b] pause GOTO:EOF Very nice, DosItHelp. |
|
| 5480. |
Solve : how to created a bootable disc..........? |
|
Answer» i have windows 3.11 dos ver.5 ... or how can i make bootable disc Check out: www.bootdisk.com You can download an executable file there. PUT a BLANK FLOPPY disc in the floppy drive, and run the file. It will make the floppy a bootable floppy. Be SURE to spend some time looking around that site. There is more and better information there. I hope this helps. |
|
| 5481. |
Solve : check internet access? |
|
Answer» how to create a BATCH that will actually sniff wheather my pc is currently connect to internet or not Ping a known address - if you get a response, you are connected @echo off What'ya THINK nwlun? DOS IT HELP? |
|
| 5482. |
Solve : how can i run batch when on a program exit? |
|
Answer» Hello there, Thanks but it doesn't help me, Then please be more clear about this Quote But the problem is that I need to know when this program is closed and run another reg file. Quote also when reg file is started it is asking for confirmation (do you want to add file into the registry...) how can i avoid that REG.EXE add adds new keys and VALUES to the Registry. You can add a VALUE to an existing key, add a new key with no values, or create a new key and a value beneath it. If you try to add a key or value that already exists, REG.EXE will warn you. REG ADD KeyName [/v ValueName | /ve] [/t Type] [/s Separator] [/d Data] [/f] * KeyName [\\Machine\]FullKey Machine Name of REMOTE machine - omitting defaults to the current machine. Only HKLM and HKU are available on remote machines FullKey ROOTKEY\SubKey ROOTKEY [ HKLM | HKCU | HKCR | HKU | HKCC ] SubKey The full name of a registry key under the selected ROOTKEY * /v The value name, under the selected Key, to add * /ve adds an empty value name for the key * /t RegKey data types: [ REG_SZ, REG_MULTI_SZ, REG_DWORD_BIG_ENDIAN, REG_DWORD, REG_BINARY, REG_DWORD_LITTLE_ENDIAN, REG_NONE, REG_EXPAND_SZ ] If omitted, REG_SZ is assumed * /s Specify one charactor that you use as the separator in your data string for REG_MULTI_SZ. If omitted, use "\0" as the separator * /d The data to assign to the registry ValueName being added * /f Force overwriting the existing registry entry without prompt Examples: REG ADD \\ABC\HKLM\Software\MyCo Adds a key HKLM\Software\MyCo on remote machine ABC REG ADD HKLM\Software\MyCo /v Data /t REG_BINARY /d fe340ead Adds a value (name: Data, type: REG_BINARY, data: fe340ead) REG ADD HKLM\Software\MyCo /v MRU /t REG_MULTI_SZ /d fax\0mail Adds a value (name: MRU, type: REG_MUTLI_SZ, data: fax\0mail\0\0) REG ADD HKLM\Software\MyCo /v Path /t REG_EXPAND_SZ /d %%systemroot%% Adds a value (name: Path, type: REG_EXPAND_SZ, data: %systemroot%) Notice: Use the double percentage ( %% ) inside the expand string I thing he means Import Value from another Reg File (*.reg) use this: REG IMPORT "C:\YourRegFile.reg" Here what you need.. ..Untested.. ------------------------------------------------------------------ @echo off set Program=whatever.exe start %program% REG IMPORT "C:\YourRegFile.reg" :loop tasklist>log.txt find /i "%Program%" log.txt if errorlevel 1 ( REG IMPORT "C:\AnotherRegFile.reg" exit ) ping localhost -w 1000 -n 2 goto loop ----------------------------------------------------------------- |
|
| 5483. |
Solve : Renaming Files in DOS with *.*? |
|
Answer» HELLO, I have files named 111-1_001.tif 111-1_002.tif 111-1_003.tif 112-4_001.tif 112-4_002.tif I need to replace the -1 and -4 with -0001 and -0004 respectively to end up with: 111-0001_001.tif 111-0001_002.tif 111-0001_003.tif 112-0004_001.tif 112-0004-0002.tif I've tried the following: Code: [Select]rename 111-1*.* 111-0001*.* and Code: [Select]rename *-1* *-0001* but nothing seems to work. Anyone have an idea of how I can change these? I have thousands of files in this format. Ideally I'd like to replace all of the -1 with -0001, or rename all of the 111-1 to 111-0001, etc. Each of the prefix's (111) will have -1 through -999. Anyone have a magical DOS command I can do this with? I'm trying to use it in a batch file. A GUI interface just isn't going to fly with my intended user. Thanks!you got to use a for loop. however i have shown EXAMPLES of this before in vbscript. SEE hereThanks for your script GhostDog. If you wouldn't mind, can you help me with the specifics of your script? I'm not well versed in vbscript. In my exisitng folder I have the following files; 565-9-0001.tif 565-9-0002.tif 565-9-0003.tf I would like to replace 565-9- with 565-0009- Here is a copy of the script from your previous message. I changed as many of the paramaters as I could figure out: Code: [Select]Dim FSO,NewPrefix, OldPrefix, oDir, objFolder,NewFileName,counter NewPrefix="565-0009-" Set FSO = CreateObject("Scripting.FileSystemObject") sDir = "i:\chavez county\unzipped" Set objFolder = FSO.GetFolder(sDir) counter = 1 For Each Files In objFolder.Files If FSO.GetExtensionName(Files) = "565-9-" Then NewFileName = NewPrefix & Padding(3,counter) & ".tif" Files.Name = NewFileName counter=counter+1 End If Next Function Padding(ValueToPad, TheDigits) theLen = Len(TheDigits) If theLen < ValueToPad Then Padding = String(ValueToPad-theLen,"0") & TheDigits Else Padding = TheDigits End If End Function Quote from: bmacbmac on July 12, 2007, 11:35:15 PM Code: [Select]Dim FSO,NewPrefix, OldPrefix, oDir, objFolder,NewFileName,counter just a minor change. You can try the batch one at the link i gave if you are more inclined to batch programming. If you want to learn vbscript, you can download this |
|
| 5484. |
Solve : making a install program from a batch? |
|
Answer» okay first off, i swear I won't use this information for bad purposes. I do not want this topic to end up like all the others I have started. Okay, so I am making an install program from a batch, and there are a couple things I need to know. 1.How do I create a shortcut using a batch?search the forum. tick "show results as messages" in Options. Simple?Quote from: CBMatt on July 10, 2007, 10:23:31 PM I hope you realize that people here may have a difficult time trusting you.Yes but its not a matter of anything that has to do with them other than helping me out. I am planning on getting into some HEAVY programming pretty soon and I want to be able to make a good homemade install system. I will be using it for part of my senior project at school. 1) yeah, it has to look something like this.. if %4[==[ goto syntax if not exist %1 if not exist %1\nul goto syntax for %%? in (%2 %3) do if not exist %%?\nul goto syntax %5 %0 %1 %2 %3 %4 rem "{newfolder}" InstallHinfSection echo > %temp%\#path#.bat path %path% path %1 echo > %temp%\#k#.inf [version] echo >>%temp%\#k#.inf signature="$CHICAGO$" echo >>%temp%\#k#.inf [DefaultInstall] echo >>%temp%\#k#.inf UpdateInis=Addlink echo >>%temp%\#k#.inf [Addlink] echo >>%temp%\#k#.inf setup.ini, progman.groups,, "group0=%6" echo >%temp%\#k#.inf setup.ini, group0,, ""%6"" echo >%temp%\#k#.inf setup.ini, group0,,""%4",""%path%"",,0," for %%? in (call DEL) do %%? %temp%\#path#.bat start/w rundll setupx.dll,%7 DefaultInstall 132 %temp%\#k#.inf del %temp%\#k#.inf move "%3\{newfolder}\*.*" %2 >nul rd "%3\{yourfolder}" 2) without having them specified? , once the shortcut is created have it moved to allusers\desktop directory 3)if you use cd\ at the beginning of a file , @echo off & cd\ & cls , so your program always runs from c:\ it will work in any folder, thanx your more helpful and trusting than many people who ignore the problem for fear i will misuse it. but thanxtheirs no question you will misuse it ,but since batch is useless.. your virus wont get very far Quote from: Diablo416 on July 12, 2007, 12:05:37 PM theirs no question you will misuse it ,but since batch is useless.. your virus wont get very farits not for a virus thanks. i am trying to create an installer for my text editor ive made. i think i found a better way to do it thoughQuote from: Diablo416 on July 12, 2007, 12:05:37 PM theirs no question you will misuse it ,but since batch is useless.. your virus wont get very farheh... that's positive reinforcement if i've ever heard it... where do you get the idea he's going to misuse it? |
|
| 5485. |
Solve : how to?? |
Answer» QUOTE from: Diablo416 on July 12, 2007, 12:15:42 PMi UNDERSTAND now , Are you SURE? Quote so instead of %1% reading "variable" ^%^1^% would READ "%1%.. c:\>echo ^%1^% %1% Quote if i used a ^ in between every letter , could i use this to escape all the LETTERS like an alternative to @echo off? Nope. c:\>echo ^h^e^l^l^o hello escaping ordinary characters does absolutely nothing. |
|
| 5486. |
Solve : home-made Text Editors? |
| Answer» NEVERMIND i GUESS a WHOLE bunch of things are messing up THANX for helpsorry i couldn't be of more use | |
| 5487. |
Solve : Problem with nbtstat command? |
|
Answer» When I USE the nbstat -A command followed by the ip adress, I don't become the remote machine's name, but: "HOST not found." , although I have a connestion with the remote computer. |
|
| 5488. |
Solve : TASKILL? |
|
Answer» hi all, tasklist /NH /FI "IMAGENAME eq safari.exe" thanks guys, jerhiggs was right! |
|
| 5489. |
Solve : set output of dir /b as variables? |
|
Answer» Ello hey Looks like you're trying to expand the variables at the prompt after the batch has finished. No can do. From my post Quote from: Me Then your simulated array, the variables TASK_0 through TASK_whatever, will be set and visible to the batch file while it is running. Code: [Select]@echo off setlocal ENABLEDELAYEDEXPANSION set LOOP=0 for /f "delims=" %%a in ('dir /b') do ( call set TASK_!LOOP!=%%a set /a LOOP+=1 ) echo use SET without args to list variables set | find "TASK_" echo. echo Expand some of them echo var0=%TASK_0% echo var1=%TASK_1% echo var2=%TASK_2% echo var3=%TASK_3% echo var4=%TASK_4% Code: [Select]S:\Test\Batch\After 06-02-09\looptest>looptest3 use SET without args to list variables TASK_0=looptest1.bat TASK_1=looptest2.bat TASK_10=pr.exe TASK_2=looptest3.bat TASK_3=mvdir.exe TASK_4=nl.exe TASK_5=od.exe TASK_6=paste.exe TASK_7=patch.exe TASK_8=pathchk.exe TASK_9=pclip.exe Expand some of them var0=looptest1.bat var1=looptest2.bat var2=looptest3.bat var3=mvdir.exe var4=nl.exe But after it has finished... Code: [Select]S:\Test\Batch\After 06-02-09\looptest>echo %TASK_0% %TASK_0% that - frankly - is extremely sexy. mate: Beers owed Alastair. (re *nix - no, but i like to keep things nice and tidy)You might want to set a variable (e.g. TASK_MAX) equal to the highest suffix number created... |
|
| 5490. |
Solve : Restoring files created by a "Batchfile" backup (Xcopy)? |
|
Answer» Hey all, |
|
| 5491. |
Solve : error level in batch file? |
|
Answer» can any one help me about error level in batch file. the problem is sloved . Not quite. Not all programs produce errorlevels. Errorlevels should be checked in reverse sequence and the actual check is for equal or greater than: Code: [Select]if errorlevel 1 goto error if errorlevel 0 goto success There is also a VARIABLE %errorlevel% (cmd extensions must be on) which is treated as any other variable (ie: if %errorlevel%==1) The errorlevels for MS commands are not standardized. XCOPY returns 0 if successful and anything from 1 to 5 if not successful. the difference between this 1. IF errorlevel N command and the Win2k and later alternative: 2. IF %errorlevel% EQU N command is that 1 means "if errorlevel is N or greater then do command" whereas 2 means "if errorlevel is exactly equal to N then do command"THANKS for the explanation, i meant by problem is sloved that for now my problem is resolved . whatever thaks for the knowladge shared by you. |
|
| 5492. |
Solve : Area Of Adventure - Advanced FTP Game Project? |
|
Answer» Added basic FTP character creation. what about my password coding ?i've been busy. |
|
| 5493. |
Solve : file rescue from a 15 years old computer.? |
|
Answer» Hello, |
|
| 5494. |
Solve : Help in batch file? |
|
Answer» Hi everyone!...and sorry my english.. |
|
| 5495. |
Solve : What version is it?? |
|
Answer» Hi all, there was a 3.1 and a 3.21 of MS-DOS but no 3.11. I shudder to think. Slightly off-topic, but did you know this? I didn't. From a blog I found. Quote Microsoft's licensing spokesperson "Rich H." told me, on 2-8-00, that ANYONE with a valid license to use any recent version of Microsoft's operating systems (Windows 95/98, NT) is also licensed to use any older version of Microsoft DOS products, and can obtain DOS 6.22 media for nominal cost from their supplemental materials unit.Interesting...This may mean that although it may be "illegal" to download those DOS 6.22 install sets that we all know about, it may not be illegal to use them. Quote supplemental materials unit. Who would this be ? ?Quote from: patio on March 04, 2009, 05:08:35 PM Quotesupplemental materials unit. The division of Microsoft that produces instruction books, etc, I believe. I think it may now be part of Microsoft Press. Quote additionally how did you try to "invoke" a directory? Quote I shudder to think. You folks NEVER used sage, crystals, eye of a knute (newt) or hair of a yak? These are essentials to have around the the TOWER as I bring up the command prompt. I do not know why I was able to get MS-DOS 6.22 this time. But I am still confused about windows living on there or not. I would think it is there because I see WIN31 when I do DIR on the c:drive. I go into WIN31 and I see . and .. 2files. I do not see any exe and I tried to just type win and win31 with no action. And yet a program lives on there that when 'involked' it have the same gui as windows 3.1. Any thoughts? Quote at the C: prompt type dir /p and see what directories on this drive come up...Some (not all) of the other directories are Autoexec bat & ONS, BACKUP, COMMAND COM, CONFIG SYS, DOS, LAN, NETSYS, PCISYS, POST, QEMM,SIGSYS, TEMP, WIN31, AND, WINSYS I will want to know how to backup to an external drive and how to image or copy to an external drive. I would like to parallel this system on another box to play with it and to have a copy. Thanks for all the FEEDBACK!! Lynx |
|
| 5496. |
Solve : using the '%' in a .bat file as a literal? |
|
Answer» Hi all, |
|
| 5497. |
Solve : How do I delete the extension file on batch program? |
|
Answer» Hi, I have a for loop that listed some files on a directory. In the for loop, the files have been saved as variable %%f. How do I filter or remove the extention of the file. For example: %%f = abc.fm I want to remove the .fm. The result should be %%f= abc You need to study the FOR variable modifiers. Type FOR /? at the prompt. The ~n modifier is the one you need. Others will get the drive, path, extension (including DOT), size, date, etc. e.g. if the file was called abc.fm then Echo %%~nF would echo abc to the console. Also, your %z% variable which you think is going to hold the last 3 chars of the FILENAME + extension string, won't work in a loop. (Study "delayed EXPANSION".) Also that string substitution ( SET z=%%f:.fm=% ) would be a problem. For the same reason and others. Anyway you don't need these now. |
|
| 5498. |
Solve : Copy Registry value from one key to another? |
|
Answer» Hello, |
|
| 5499. |
Solve : Test to see if Batch File is running? |
|
Answer» Oh, I was thinking to see if there are to sessions of cmd.exe running. Maybe the batch file could create a file when it starts, and delete it when it completes. the only way that you could really quit would to click the exit button in the corner of the screen. Or doing quit. A batch file will quit when it encounters the EXIT command. I may have misunderstood your requirements, but what I was thinking of was something like this: @ECHO Off :: Check if temporary file exists If Exist %temp%\AlreadyRunning.tmp ( Echo This batch file is already running & Goto :EOF) :: Else create it Echo . > %temp%\AlreadyRunning.tmp :: Carry on with remainder of batch file Echo. Echo Do whatever here, then Echo. :: Delete temporary file Del %temp%\AlreadyRunning.tmp My program. Doesn't really have a beginning and an end. It has a old GUI with options.Quote from: BatchFileCommand on March 03, 2009, 07:57:08 PM My program. Doesn't really have a beginning and an end. It has a old GUI with options. all programs have a beginning and an end. instead of exiting the batch file using EXIT, you can REDIRECT to a label that performs the necessary cleanup.Even if it does have a beginning and an end. What if someone doesn't know about the file and clicks the X button in the corner of the screen. Then they would NEVER be able to use it again. This is why I stopped using this method in my batch files/programs early on. |
|
| 5500. |
Solve : Dos Query? |
|
Answer» Hello Sir, D) many times I see that some windows file get corrupt . So how to recover that file again . Your troubles could easily escalate. If you password protect or encrypt folders etc, they will be lost for ever if the next corruption happens to a file holding the password or encryption key. I think you should fix your computer so that file corruption is no longer its life style, otherwise after encryption etc. you could be locked out for ever. Regards Alan Quote from: Carbon Dudeoxide on November 04, 2008, 05:08:55 AM Homework of a sort?Quote from: anjeepsolution on November 04, 2008, 04:46:47 AM C) Any command to see all the ip address of all the computer connected to network? If it's a network with a routher then the router should give you a list of IP's/computer names on the network, try to put this in your browser... 192.168.1.254 FBQuote from: anjeepsolution on November 04, 2008, 04:46:47 AM
What do you think? i Downloaded Migo digital Vault from google. So i WOULD like to know will this software help me to put password to my folder. Please inform me because i have this sofware in my pen drive. And till now i have not installed in my pc. So if you suggest that it is safe to use it . Then i will download it. Regards. anjeep |
|