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.
| 3251. |
Solve : Opening bat files remotely? |
|
Answer» Hi I'm new here and I was wondering if it's possible to open a bat FILE remotely on another computer in your home network. Hi I'm new here and I was wondering if it's possible to open a bat file remotely on another computer in your home network.Post count+possible danger=We're not helping you. Innocent until proven guilty, but we don't have to help you do something possibly dangerous!I'm not TRYING to do anything dangerous. I'm working on a LAN Messenger that uses net send and I was wondering if it's possible to either send or open that batch file from another computer.Quote from: delibrete on April 13, 2009, 06:06:28 PM I'm not trying to do anything dangerous.A LAN Messenger...wow. Using Net Send? I can make one in less than 3 minutes that uses text files on a network drive, but I've never personally used net send... And to answer your question, I don't think it's possible UNLESS you use remote destop CONNECTION...Hmmm, I'm not sure what your trying to say about net send but thanks for the helpQuote from: delibrete on April 13, 2009, 06:13:07 PM Hmmm, I'm not sure what your trying to say about net send but thanks for the helpWhat do you mean. I just said that I've never used net send before, and that I can make a LAN Messenger in less than 3 minutes.oh ok if you curious about what I'm doing then here it is (Note: it's not completed and it looks very n00bish) @echo off net start messenger :main cls TITLE Lan Messenger v1.0 BETA color 02 echo ####################### echo Lan Messenger v1.0 BETA echo ####################### echo Welcome net users net view set /p n=Select User: echo You are chatting with %n% goto A :A echo - set /p m=Type message: net send %n% %m% Goto AQuote from: delibrete on April 13, 2009, 06:24:58 PM oh okYou can remove the FIRST goto A, as it will go to A anyway.oh yeah, silly me thx helpmeh, how would you make a Lan messenger?Quote from: delibrete on April 13, 2009, 06:53:09 PM oh yeah,Lol, it's a common mistake. Do you have a network drive, (files shared between all the computers)?well, I'm not connected to any home networkQuote from: delibrete on April 13, 2009, 06:58:07 PM well,Will you be soon/some time in the almost near future?Hopefully, I'm trying to convince mum to get a wireless router and some adaptersQuote from: delibrete on April 13, 2009, 07:05:52 PM Hopefully,Well, here is a 2-part LAN Messenger (I use it at school a lot) File one: CODE: [Select]@echo off set /p usr=Username: :loop cls set /p msg=Message: echo %usr%^: %msg% >> FILEONNETWORK.EXTENSION goto loop File two: Code: [Select]@echo off :loop cls type FILEONNETWORK.EXTENSION ping localhost -n 2 -w 1000 > nul It's bare-bones, but it works. You can add any fancy stuff you want to it. |
|
| 3252. |
Solve : Partition Resize From Command line?? |
|
Answer» Is there a program that I can run in DOS on the command line that I can shrink an NTFS volume? I'd like to make it so I can put it on a CD and it will automatically run after making a batch script so there WONT be any user intervention. (This is for large hard drives with little data on them so data loss shouldn't be a problem) Diskpart will work in dos even though it's part of windows ?Read the link Patio posted. Or this one: "DiskPart Command-Line Options" http://technet.microsoft.com/en-us/library/cc766465(WS.10).aspx Diskpart maybe command line but it cannot operate outside of windows like MS-DOSif you can get you hands on a Linux boot CD there a utilities that will do what you are looking for. A different option WOULD be to get your hands on a ERD Commander from systools. some very good tools and utilities in a windows like ENVIRONMENT that hooks into the reg of the host COMPUTER. The ERD is put on a boot CD or USB so it runs outside of windows. pure DOS cannot access hard drives larger then... well, I forget the exact value, but I don't think it exceeds around 64 GB. Also it does not recognize NTFS partitions. There is no pure DOS command line utility you can use for resizing partitions. The closest you can get is probably fdisk, excluding the good number of tools available for this purpose (I believe there are tools for resizing partitions that will run on DOS... but they wil lbe too old to recognize NTFS, I think. However as suggested there are a number of already existing boot CD solutions that posess this ability.Thanks for your suggestions guys. I already do have a ubuntu bootable disk and an EDR commander. They are great utilities. I know they can resize partitions by hand, but how can i automate the task? Because that's really the goal here. |
|
| 3253. |
Solve : How Extract Value between Parethesis? |
|
Answer» I need to extract the value between parentheses into a variable, I am not sure if there an easy way to do it. I need to extract the value between parentheses into a variable, I am not sure if there an easy way to do it. There is no doubt that the batch solution is much better than the the VBS attempt above. Plus Et_Phone, the original poster, requested Batch. VBS needs a board of its own. p.s.: VBS failed to assign testqm and running to variables. Casper failed to read instructions from the original poster? Quote from: billrich on November 09, 2009, 05:29:39 PM There is no doubt that the batch solution is much better than the the VBS attempt above. Plus Et_Phone, the original poster, requested Batch.no, you lost soul. the vbscript gets all text between parenthesis , no matter how many. The batch only gets 2nd and 4th. Quote VBS needs a board of its own.tell that to the administrator of the site. Quote p.s.: VBS failed to assign testqm and running to variables.trivial trivial. you are always harping on trivial things. you sound like a woman to me. Quote Casper failed to read instructions from the original poster?the OP says DOS only, which i will assume he meant cmd.exe , so until he says "i don't need a vbscript", i will still keep posting vbscript solutions.. so what you gonna do about it ? go suck a thumbSalmon Trout, thanks for the response, I never realize that with DELIM, one can specify more than one expression. Thanks to all for your response. The reason I did not ask for VBScript, its because none of my servers have VB on it....Quote from: et_phonehome_2 on November 10, 2009, 05:48:17 AM its because none of my servers have VB on it....its vbscript, not VB.!! what WINDOWS server version are you running ? |
|
| 3254. |
Solve : i need script? |
|
Answer» Hi all if you can download Gawk for windows (see my sig), here's an alternative. Bloody *censored*! Have you got shares in Gawk, Inc? (or a word that rhymes?) Quote from: Dias de verano on April 08, 2009, 12:58:22 AM Bloody <censored>! Have you got shares in Gawk, Inc? (or a word that rhymes?)you should just go fly a kite. Code: [Select]@echo off setlocal enabledelayedexpansion for /f "tokens=1-4* delims= " %%a in (input.txt) do ( echo %%b | find "access-list">NUL && ( set filename=%%d.txt echo Creating !filename! if exist "!filename!" del "!filename!" echo %%a %%b %%c %%d %%e>>"!filename!" ) echo %%b | find "access-list">nul || ( echo %%a %%b %%c %%d %%e>>"!filename!" ) ) Quote from: Dias de verano on April 08, 2009, 01:52:21 AM Code: [Select]@echo off dias, good eyes, i just notice that the filename is from the contents of txt file. i need a pair of good eyes too you can actually combine the echo|find && || , INSTEAD of 2 seperate check. multiple call of echo|find does a quick job, but i find the trick is somehow slow for large files. Quote from: Reno on April 08, 2009, 02:04:40 AM i find the trick is somehow slow for large files. indeed. however... Code: [Select]@echo off setlocal enabledelayedexpansion set true=1 set false=0 for /f "tokens=1-4* delims= " %%a in (input.txt) do ( set firstline=%false% echo %%b | find "access-list">nul && set firstline=%true% if "!firstline!"=="%true%" ( set filename=%%d.txt echo Creating !filename! if exist "!filename!" del "!filename!" echo %%a %%b %%c %%d %%e>>"!filename!" ) else ( echo %%a %%b %%c %%d %%e>>"!filename!" ) ) thank you all .... The scripts worked perfectly well Thanks again |
|
| 3255. |
Solve : Swap text file colomn? |
|
Answer» Dear EXPERTS, |
|
| 3256. |
Solve : How to invalid invalid string input? |
|
Answer» Hi, |
|
| 3257. |
Solve : Ask User for Input String and then play with IF clause? |
|
Answer» Hi, |
|
| 3258. |
Solve : Time, in FOR [SOLVED]? |
|
Answer» I am trying to get the hours and minutes of the current system time in FOR, and SET the hours as %h% and the minutes as %m%... Just looked through the FAQ (I was bored) and found the solution! You're supposed to do that before you ask the question. Quote from: Dias de verano on April 14, 2009, 11:15:20 AM You're supposed to do that before you ask the question.BUT, (and this is a good reason) some people may have the same problem and not know that the FAQ exists. I actually didn't know that there was a FAQ for MS-DOS. |
|
| 3259. |
Solve : Break line while appending files? |
|
Answer» Hi |
|
| 3260. |
Solve : Laptop Printer preview help? |
|
Answer» I have a Dell Pentium III Microsoft Windows XP LAPTOP. It shares a HP photosmart 1115 series printer with a Dell Pentium 4 Microsoft Windows XP computer. I have both COMPUTERS set up to show HP print previews, however, the preview only appears on the computer, even when I print from the laptop. Can anyone give me some suggestions on how I can get the preview to show on my laptop when I print from it? Welcome to the CH forums. |
|
| 3261. |
Solve : Permanently change the PATH from within a DOS Batch File? |
Answer» QUOTE from: iONik on April 15, 2009, 03:41:46 PMHere's my mountain of code to do the job I was after... Nope. To add \dir to path: (you append it) set path "%path%;\dir" see here: http://www.google.co.uk/search?source=ig&hl=en&rlz=&=&q=setx+path&btnG=Google+Search&meta=lr%3D Quote from: Dias de verano on April 15, 2009, 03:48:58 PM Nope. To add \dir to path: (you append it) My "mountain of code" (not really) does do the trick, but you have cut that BACK about as far as it can go I'd guess. But I will need SETX Code: [Select]setx PATH "%PATH%;C:\Windows\newdir" -m |
|
| 3262. |
Solve : extract string from file to variable? |
|
Answer» I wish to extract a date/time string from a text file into a variable which I can test against the current MACHINE date/time. Can this be done in DOS or is VB a better bet?SHOW what you want to do, with SAMPLE file examples and output text file line 3 looks similar to this: abcde dd/mm/yyyy hh:mm:ss I want to extract the date/time and compare it against current machine time so that if machine time is greater I can call another program.handling date is a chore using DOS(cmd.exe), its better if you learn to use vbscript. Check my sig for vbscript tutorial link. Inside, you can look up various Date functions. While you are at that, if you are not restricted, you can download GAWK for windows(ALSO my sig) and try this script. Code: [Select]BEGIN{ now=systime() } NR==3{ strdate=$(NF-1);strtime=$NF m=split(strdate,d,"/") n=split(strtime,t,":") thedate = d[3]" "d[2]" "d[1]" "t[1]" "t[2]" "t[3] if ( mktime(thedate) > now ){ print "file date greater than system date" }else{ print "system date greater than file date" cmd="mycmd args1 args2" # put you command and arguments here. system(cmd) } } save the above as myscript.awk and on command line Code: [Select]c:\test> gawk.exe -f myscript.awk file |
|
| 3263. |
Solve : Password Hiding? |
|
Answer» Quote basically, it's impossible to package a batch as a PURE EXE- and if somebody "needs" too, then there is something amiss. Who said that? This idea was to hide the password from those who would not be motivated to use EXTRA ordinary METHODS. That can be done with a batch file converter.Quote from: Geek-9pm on April 15, 2009, 04:01:11 PM Who said that? This idea was to hide the password from those who would not be motivated to use extra ordinary methods. That can be done with a batch file converter. Opening the resulting exe file in a TEXT editor I don't think would count as a "extraordinary" method.Quote Opening the resulting exe file in a Text editor I don't think would count as a "extraordinary" method.There are other versions of BAT2EXE that make the original stings meaningless in a text editor. The does not mean it is totally secure, but out of the reach of many advanced power users. Is this worth pursuing? Another alternative is to have a custom program to deploy passwords over a NETWORK. The original question was if you can hide a password in a BATCH file. The short answer is no. The long answer is you can make an utility that is easy to use and get the job done. And it can be put in a batch file.And the batch can be deployed over a network and not revel the password . Was this a homework exercise? |
|
| 3264. |
Solve : XP Recovery HELP!? |
|
Answer» Hello, if you in dos screen the password default is just press (enter)dont put anything Enter won't do anything, and a different copy of Windows won't work.Quote I haven't lost my password, rather can't remember it This is a contradiction...also the basis of your dilemna. How do you go about losing an Admin password ? ?He could try a Emergency Boot if he has another computer with Win XP on it.you can try this: at logon press ctrl+alt+del TWICE, there should pop up a message to enter username and password, type administrator as username and leave password blank, press enter or boot into safe mode and use master admin account (but i think in first suggestion its using that account)as i stated a oem windows disc and correct SETUP in bios i.e the first boot priorty is cd-rom then this will overwrite any windows as it will format your drive but has to be oem version and have your boot in bios set up for cd-rom first then hdd ETC....get to bios press delete on start...Control-Alt-Delete restarts my PC. I am directed to a screen that says; Microsoft Windows XP Recovery Console with three options; 1: D:\MiniNT 2: D:\I386 3: C:\Windows. I type 3, then it asks for the Administrator Password, which might be something I used 5 years ago for security reasons but don't use anymore. I've tried all passwords which I thought it might be, no luck. Pressing enter just says "Invalid". Do you have another computer with a CD burner or atleast it has Win XP on it? |
|
| 3265. |
Solve : Runtime error 217 at 0281F57D and 216? |
|
Answer» Runtime error 217 at 0281F57D and 216 I suspect one of the .exe is throwing this error. I suggest you add a pause statement before each to narrow down which one doesn't like it. Once you know you can decide how to work around it. I do inmediately and will comment I try this : rem M:\Archivos de programa\AutoCAD 2002 Esp\acad.exe M:\Documents and Settings\JOSE\Escritorio\Utilidades Varias\SOFTWARE TECNICOS\AutoCAD 2002 Esp.lnk pause ping -n 1 -w 25000 1.1.1.1 >nul wait pause "M:\Archivos de programa\Procuno\BTwin\BtWin.exe" pause rem "M:\Documents and Settings\JOSE\Escritorio\Utilidades Varias\SOFTWARE TECNICOS\BTwin. Baja Tensión.lnk" ping -n 1 -w 25000 1.1.1.1 >nul Y:\Ingenieria ping -n 1 -w 5000 1.1.1.1 >nul ping -n 1 -w 5000 1.1.1.1 >nul Y:\GABINETE\PROYECTOS ping -n 1 -w 5000 1.1.1.1 >nul ping -n 1 -w 5000 1.1.1.1 >nul M:\Documents and Settings\JOSE\Escritorio\Utilidades Varias\RunGoldmine.bat ping -n 1 -w 5000 1.1.1.1 >nul ping -n 1 -w 5000 1.1.1.1 >nul M:\Documents and Settings\JOSE\Datos de programa\Microsoft\Internet Explorer\Quick Launch\Mostrar escritorio.scf pause M:\Documents and Settings\JOSE\Escritorio\Utilidades Varias\mm\Menu Gabinete.doc pause rem M:\Documents and Settings\JOSE\Escritorio\Utilidades Varias\SOFTWARE TECNICOS\Acceso directo a Menu Gabinete.doc.lnk ping -n 1 -w 50000 1.1.1.1 >nul M:\Documents and Settings\JOSE\Datos de programa\Microsoft\Internet Explorer\Quick Launch\Mostrar escritorio.scf But I don't see stop or pause. Certainly I'm doing something BAD. I don't remember what to do. Can you help me ? I try the code above and receive no error. After I try with this code and received the error : rem M:\Archivos de programa\AutoCAD 2002 Esp\acad.exe M:\Documents and Settings\JOSE\Escritorio\Utilidades Varias\SOFTWARE TECNICOS\AutoCAD 2002 Esp.lnk echo ejecutado autocad pause ping -n 1 -w 25000 1.1.1.1 >nul wait pause "M:\Archivos de programa\Procuno\BTwin\BtWin.exe" echo ejecutado btwin pause rem "M:\Documents and Settings\JOSE\Escritorio\Utilidades Varias\SOFTWARE TECNICOS\BTwin. Baja Tensión.lnk" ping -n 1 -w 25000 1.1.1.1 >nul Y:\Ingenieria ping -n 1 -w 5000 1.1.1.1 >nul ping -n 1 -w 5000 1.1.1.1 >nul Y:\GABINETE\PROYECTOS ping -n 1 -w 5000 1.1.1.1 >nul ping -n 1 -w 5000 1.1.1.1 >nul M:\Documents and Settings\JOSE\Escritorio\Utilidades Varias\RunGoldmine.bat ping -n 1 -w 5000 1.1.1.1 >nul ping -n 1 -w 5000 1.1.1.1 >nul M:\Documents and Settings\JOSE\Datos de programa\Microsoft\Internet Explorer\Quick Launch\Mostrar escritorio.scf echo ejecutado mostrar escritorio pause M:\Documents and Settings\JOSE\Escritorio\Utilidades Varias\mm\Menu Gabinete.doc echo ejecutado menu gabinete.doc pause rem M:\Documents and Settings\JOSE\Escritorio\Utilidades Varias\SOFTWARE TECNICOS\Acceso directo a Menu Gabinete.doc.lnk ping -n 1 -w 50000 1.1.1.1 >nul M:\Documents and Settings\JOSE\Datos de programa\Microsoft\Internet Explorer\Quick Launch\Mostrar escritorio.scf I tried putting @echo off , at the beginning, but I don't see any window and can't key nothing. Sometimes the SCRIPT give me error and other don't give me error. |
|
| 3266. |
Solve : Upper and Lower case both should be accepted? |
|
Answer» Hi, Don't work for me! Code: [Select]C:\Users\_CORE>if /I 'cat' equ 'cat' echo OK OK C:\Users\_CORE>if /I 'CAT' equ 'cat' echo OK OK C:\Users\_CORE>if /I 'CaT' equ 'cAt' echo OK OK C:\Users\_CORE>if 'CaT' equ 'cAt' echo OK How it can't work ?Quote from: devcom on April 14, 2009, 02:51:54 PM How it can't work ? YEAH, right! Code: [Select]C:\>if /i "GeeK"=="gEEk" echo OK OK What do you mean, Geek-9PM? You should know better than to give that OLD "doesn't work" stuff here. Quote Code:DUH, do not work for me. leave out C:\> OH! Learn something everyday Quote from: Geek-9pm on April 15, 2009, 05:34:54 PM DUH You said it... |
|
| 3267. |
Solve : a batch with delete backup file in directory? |
|
Answer» I need an help for delete in the directory c:\backup the 5th day older file RESPECT the current DATE |
|
| 3268. |
Solve : re problem? |
|
Answer» if you have an OEM version of windows and your boot order is set-up correct in bios this can be CHECKED by pressing (delete) key on boot placing cd-rom as first boot then this will overwrite any windows as it formats the drive anyway... |
|
| 3269. |
Solve : Searching through a .zip folder with DIR? |
|
Answer» Anybody have a clue how to find all .TXT files within a .zip file? Hopfully using the dir command in MS-DOS?zip files are- files, not directories. |
|
| 3270. |
Solve : How can I get File Modified time with 10 mSec resolution ?? |
|
Answer» I am using cscript code that has a 1 second RESOLUTION with |
|
| 3271. |
Solve : How to check for files and folders in a directory? |
|
Answer» Hi All, |
|
| 3272. |
Solve : Executing a program, folder, document after a time specified? |
|
Answer» Oh thanks, Devcom. Completely forgot about that. Quote from: Carbon Dudeoxide on May 03, 2009, 08:18:47 AM You might want to have a look at the WAIT command (not included with Windows). That command is used in the bat created by Startup Manager, but it's not with time, only begin the next when the last has finished. Quote from: devcom on May 03, 2009, 10:22:22 AM or you can use this: I'll try. Now I have a little problem. I don't remember how to resolver but I have resolved in the past. I see the DOS windows while i'm executing the bat. I would like an invisible command window. Where can i find more information about ping ? Thanks Excuse my LANGUAGE. I'm from Canary Islands try ping /? in cmd, ping is used to test connection etc., but this is the easiest way to make wait Quote from: devcom on May 03, 2009, 12:45:32 PM try ping /? in cmd, ping is used to test connection etc., but this is the easiest way to make wait okis, a trick I'm using ping, but in this bat I don´t get the CLEAN window finally . What can i do ? M:\Archivos de programa\AutoCAD 2002 Esp\acad.exe ping -n 1 -w 5000 1.1.1.1 >nul ping -n 1 -w 5000 1.1.1.1 >nul ping -n 1 -w 5000 1.1.1.1 >nul ping -n 1 -w 5000 1.1.1.1 >nul "M:\Archivos de programa\Procuno\BTwin\BtWin.exe" ping -n 1 -w 5000 1.1.1.1 >nul ping -n 1 -w 5000 1.1.1.1 >nul ping -n 1 -w 5000 1.1.1.1 >nul Y:\Ingenieria ping -n 1 -w 5000 1.1.1.1 >nul ping -n 1 -w 5000 1.1.1.1 >nul Y:\GABINETE\PROYECTOS ping -n 1 -w 5000 1.1.1.1 >nul ping -n 1 -w 5000 1.1.1.1 >nul M:\Documents and Settings\JOSE\Escritorio\Utilidades Varias\RunGoldmine.bat ping -n 1 -w 5000 1.1.1.1 >nul ping -n 1 -w 5000 1.1.1.1 >nul M:\Documents and Settings\JOSE\Datos de programa\Microsoft\Internet Explorer\Quick Launch\Mostrar escritorio.scf M:\Documents and Settings\JOSE\Escritorio\Utilidades Varias\mm\Menu Gabinete.doc ping -n 1 -w 5000 1.1.1.1 >nul ping -n 1 -w 5000 1.1.1.1 >nul ping -n 1 -w 5000 1.1.1.1 >nul ping -n 1 -w 5000 1.1.1.1 >nul ping -n 1 -w 5000 1.1.1.1 >nul M:\Documents and Settings\JOSE\Datos de programa\Microsoft\Internet Explorer\Quick Launch\Mostrar escritorio.scf M:\Documents and Settings\JOSE\Datos de programa\Microsoft\Internet Explorer\Quick Launch\Mostrar escritorio.scf ****** Mostrarescritorio.scf is equivalent to ShowDesktop.scf in english Thanks Excuse my language. I'm from Canary Islands The batch file doesn't make any sense. All the 'waiting' is useless and unnecessary. What is the batch file SUPPOSED to do. Can you talk us through it?@Esgrimidor ping -n 1 -w n*1000 1.1.1.1 >nul where n is number of seconds to wait and what do you mean by "clean window", you mean cls command ?Quote from: Carbon Dudeoxide on May 04, 2009, 07:00:44 AM The batch file doesn't make any sense. Is for open a lot of programs I use in my WORK to be prepared. Quote from: devcom on May 04, 2009, 07:10:08 AM @Esgrimidor A fellow answer that is Start work.bat /MIN this parameter is not possible in the bat created with yLaunch2 but it's possible inside the bat created. Perhaps is better express as Show Desktop |
|
| 3273. |
Solve : kill a batch? |
|
Answer» Hi, |
|
| 3274. |
Solve : Need help using the copy command? |
|
Answer» Hello, does anyone know if there is a SWITCH that can be used with the copy command to update the Date Modified to the current datetime on the destination?No there is not. Hello, does anyone know if there is a switch that can be used with the copy command to update the Date Modified to the current datetime on the destination?You can do it natively through vbscript. assuming you already map to e:\ Code: [Select]Set objFS = CreateObject("Scripting.FileSystemObject") Set objArgs = WScript.Arguments strFileToCopy = objArgs(0) 'file to copy strDestination = objArgs(1) 'copy to destination strComputer = "10.10.10.10" 'your remote computer IP Set objShell = CreateObject("Shell.Application") Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Set ColDate = objWMIService.ExecQuery("Select * from Win32_LocalTime") ' Get remote computer date and time For each strDate in ColDate strDateToChange = CDate(strDate.Day & " " & strDate.Month & " " & strDate.Year) strTimeToChange = CDate(strDate.Hour & ":" & strDate.Minute & ":" & strDate.Second ) Next ' copy the file over to destination objFS.CopyFile strFileToCopy,strDestination & "/" & strFileToCopy Set objFolder = objShell.NameSpace(strDestination) ' set the file time stamp to that of the remote objFolder.Items.Item(strFileToCopy).ModifyDate = strDateToChange & " " & strTimeToChange Set objWMIService = Nothing Set objFolder = Nothing Set objShell = Nothing usage: Code: [Select]c:\test> cscript /nologo modifydate.vbs "file.txt" "e:\destination" |
|
| 3275. |
Solve : Editing file names using bat files?? |
|
Answer» First off I would like to thank the forum and knowledgable poster for there help here. you mean: Thanks for the reply, your 2ND example is beyond me, I did SEE that in another post and it did work as far as echoing to the screen but I was not able to modify it to work for me, however your first example( can`t believe I did not think of it) should do just fine. ThanksWell the rename as simple as it seemed I was not able to use as it is a little more complicated than just renaming a file. In my bat file, which runs under a CMD window in Vista, the original file gets copied then archived away. The copied file has changes made to it and is then named for use. At this point I really have no way of TELLING which file goes with which file so I hoping to take the version # out of the original file and have it added to the new file name. Simply renaming does not work. The 2nd method devcon provided me does not work under my CMD window. I get "The syntax of the command is incorrect". After trying it in immeditate mode on the command line the %%F causes a "%%F was unexpected at this time error". Removing one of the % does allow it to work and changing the command "echo" to "set f =" does MAKE it an environmental variable showing the file name. That is what I was looking for and I assume at this point it would be easier to edit and just take the version # from the orginal file name. However that only worked when TYPE on the command line. Any idea what is causing the syntax error when the bat file is run? Thankswhat is it that not working? ren oldfilename_*.abc newfilename_*.abc this will work as long as string length of oldfilename equal to string length of newfilename type: dir/b *.abc and post the few lines of the screen output here single % is used on command prompt, when you write the code into batch file you use double percent %%.Again, I am lost. What did you need FOR for? Code: [Select]RENAME *_???.abc NewName_???.abc Seems to be that Dev's for loop is to find all files in the current directory and sub-dirs that have the abc extension, and everytime it finds a file with that then show the name of the file. if he means %~nl instead of %~nFThanks guys without your help as I would never had gotten this without it. Code: [Select]for /F %%F in ('dir /b *.zip') do set 1 = %%F This gives me environmental variable 1, as seen under set command, = oldfilename_date_version_type.zip. I assume I can edit the variable 1 to take date_version_type from the old file and add that to the new file after changes are made to the file to give me newfilename_date_version_type.abc. Thanks for the help and I`ll see if I can edit the variable tonight. |
|
| 3276. |
Solve : Finding multiple strings in a text file? |
|
Answer» Batch example: |
|
| 3277. |
Solve : xms alloc error? |
|
Answer» I am currently working on a boot disk that will load drivers and such onto a ram drive. I am using xmsdsk.exe to make the drive. This error appears on computers which have more than 32MB RAM, as most computers in our days do. Aladdin 'thinks' that it has too little RAM, and refuses to run. This error seems to pop up in pure DOS MODE only, not when you run the game under Windows. However, under Windows, you may EXPERIENCE sound problems, so you might want to run it in pure DOS. In which case, use the EATXMS program, as suggested by et2k, to occupy all the RAM except the last 32 megabytes.Quote search for the file eatxms.exe/com on search engine.after you get it,you have to "eat memory".for aladdin you need less then 32 mega.so if you have 64 megabyte,you should write something like eatxms 17000.now run aladdin normaily.for some sound cards,you have to wait for 1-2 min before the game starts.ok but I am trying to run this on multiple systems. They will very in the amount of ram they have available to them.what is wrong with using RAMDISK.SYS to create a RAM disk? it supports a switch for using extended memory.nothing I figured it out. We were using the /T switch on xmsdsk.exe. That works fine until you have more memory then 2048. I removed the switch and it now works fine. |
|
| 3278. |
Solve : Batch file to run a program? |
|
Answer» Hi Microsoft Windows XP [Version 5.1.2600]As you can see here I have named it "test.BAS". Now I can run the program using the following command line option: Quote d:\bin>qbasic /run testThe output will be like this: Quote this isOf course, I had to enter the text "HELLO" and the program at code my response. Now, using the editor I will make a small program that I just CALL "inpu" and save it. The content is as follows: Quote d:\bin>type inpuNow I am ready to test the redirection feature of the, actually the command line in Windows XP, as follows: Quote d:\bin>qbasic /run test <inpuWorks like a happy puppy! Hope this is of some help to you. Please note this is QBasic, not the compiler. |
|
| 3279. |
Solve : Setting a variable qual to two other variables? |
|
Answer» I am trying via a DOS window (XP) to set a third variable equal to two other variables. |
|
| 3280. |
Solve : Record size? |
|
Answer» HELLO FOLKS, In a document about cp/m operating system, it says that information was saved on the MEDIA in RECORDS of 128 bytes, and the sector size was 128 bytes as well. In present time, the sector size is 512 bytes: What is the correct definition for "record" and "record size"? Thank you ziloo |
|
| 3281. |
Solve : Batch - How to Read text file variables in a loop? |
|
Answer» What he's doing is pure trollery. Needs banning. ABC.txt with 1500 lines (XP SP3, 3. 0 GHZ P4 Prescott, Seagate Free Agent 320GB usb external HDD)if you see my gawk code, its makes use of associative arrays. every time the same entry is encountered, the key is "overwritten" and CURRENT value is stored. At the end of file iteration, all it has is just latest entry of each computer name. I think batch can "simulate" this kind of behaviour using delayed expansion. Just feel that its nicer to go through memory than file i/o.Quote from: Salmon Trout on November 14, 2009, 09:05:12 AM What he's doing is pure trollery. Needs banning. No, the fishman is the fake and Troll. And now Casper is using vulgar language. Again no one reading this thread knows what Salmon Trout is talking about. Yogesh123, the original poster, wrote: "How does it works exactly? what is *.pqr & 'type %%B' & %%~nB"The original post seems pretty clear that it indeed the last time entry for each machine name that they wanted It is in bold. Of course we could simply print out the very same thing being used as input and call it a day, but that's treading awfully close to what a politician might do (which is quite close to nothing). This is all well and good everybody makes mistakes such as this, or misunderstands posts. But to then turn around, and for the sole reason that one was unable to understand the query, accuse others of having multiple accounts to justify in their mind that they were in fact at a disadvantage is nothing short of childish. Billrich: your claims that they are the same person are based on a self-deluded fantasy that the provided solution does not meet the request PUT forth by the OP, when, in fact, it does. Additionally, the very portion that you missed in your solution was bold. And lastly, Yes, I KNOW I provided no solution. But is it not true that no solution is better then a wrong one? At least I admit that I did not post a solution, there is no admittance to the clearly obvious fact that you omitted a few key requirements from your original response. This is no problem, a good number of your solutions, while provided in an unorthodox way do solve the OP's problem and they are content. However one cannot say they are perfect all the time, especially when one tries to cover so many threads; as you've said yourself, you are LEARNING, we all are. It never hurts to concede when somebody is better at something, and I have to say from reading many of his posts (I think it's technically in the tens of thousands now, actually) I am not ashamed to say that his abilities with batch(especially regarding the NT extensions), and I'm sure many other things, is far greater then mine; the same goes for ghostdog and his reportoire of script languages; for me to not concede these truths is not a sign of strength in my abilities but rather a folly in that I cannot see my own weaknesses. When one cannot see their own weaknesses, they do not know whereupon to build strength. hmm, that got a little weird... anyway, basically, when one finds one solution to be inadequate to the original query, it is not a sign of weakness to say, "hey, I suppose I read wrong or was mistaken", and the same goes for solutions that do work but a better alternative is presented (I believe ghostdog has outscripted me on one or two threads , there is no reason the defend a inferior solution unless it has distinct advantages that are applicable to the Original Posters question. curses, why must my posts be so long... and lastly, the original posters follow-up question was answered.Quote from: gh0std0g74 on November 14, 2009, 09:06:58 AM if you see my gawk code, its makes use of associative arrays. every time the same entry is encountered, the key is "overwritten" and current value is stored. At the end of file iteration, all it has is just latest entry of each computer name. I think batch can "simulate" this kind of behaviour using delayed expansion. Just feel that its nicer to go through memory than file i/o. I agree; my code is, I freely admit, nothing more or less than a quick hack. Personally, I would rather tackle the requirement using VBscript. Quote from: BC_Programmer on November 14, 2009, 09:25:39 AM When one cannot see their own weaknesses, they do not know whereupon to build strength. That is an extremely true and profound remark. Further, a person who is (obviously!) painfully aware of their own weaknesses, but out of pig-headedness and vanity refuses to see or address them is in an even more pitiful position.Quote from: billrich on November 14, 2009, 09:12:37 AM Again no one reading this thread knows what Salmon Trout is taking about.i do. Got it! I knew there must be a way that does not involve files. You have environment space to play with. Remembered about the 'am' & 'pm' part of the time as well. (Why won't people use the 24 hour clock like we do here in Europe? makes things so much simpler.) Code: [Select]@echo off for /f "tokens=1,2,3 delims= " %%A in (ABC.txt) do call set lastentry_%%A=%%B_%%C for /f "tokens=1,2,3,4 delims=_=" %%A in ('set ^| find "lastentry"') do echo %%B %%C %%D >> logfile.txt logfile.txt (after 1 run) - note that using append >> operator will MAKE logfile.txt grow each time the batch is run Code: [Select]WST123 11:27 pm WST456 03:27 pm WST567 07:27 pm WST789 12:27 pmQuote from: Salmon Trout Got it! I knew there must be a way that does not involve files.congrats. now how about one that uses delayed expansion. would like to see how it can be used to solve this. |
|
| 3282. |
Solve : XCOPY PLEASE HELP? |
|
Answer» i'm after a batch file which will copy only those files that have changed today or as a part of this build and deploy them to target servers. if the files to copy are images, globalsources, css etc then then need to copy as normal. If there dlls they need to register them on the target server.... and you think shouting IN CAPITALS is going to make people willing to help? i'm after a batch file which will copy only those files that have changed today or as a part of this build and deploy them to target servers. if the files to copy are images, globalsources, css etc then then need to copy as normal. If there dlls they need to register them on the target server. C:\>XCOPY /? Copies files and directory trees. XCOPY source [destination] [/A | /M] [/D[:date]] [/P] [/S [/E]] [/V] [/W] [/C] [/I] [/Q] [/F] [/L] [/G] [/H] [/R] [/T] [/U] [/K] [/N] [/O] [/X] [/Y] [/-Y] [/Z] [/EXCLUDE:file1[+file2][+file3]...] source Specifies the file(s) to copy. destination Specifies the location and/or name of new files. /A Copies only files with the archive attribute set, doesn't change the attribute. /M Copies only files with the archive attribute set, turns off the archive attribute. /D:m-d-y Copies files changed on or after the specified date. If no date is GIVEN, copies only those files whose source time is newer than the destination time. /EXCLUDE:file1[+file2][+file3]... Specifies a list of files containing strings. Each string should be in a separate line in the files. When any of the strings match any part of the absolute path of the file to be copied, that file will be excluded from being copied. For example, specifying a string like \obj\ or .obj will exclude all files underneath the directory obj or all files with the .obj extension respectively. /P Prompts you before creating each destination file. /S Copies directories and subdirectories except empty ones. /E Copies directories and subdirectories, including empty ones. Same as /S /E. May be used to modify /T. /V Verifies each new file. /W Prompts you to press a key before copying. /C Continues copying even if errors occur. /I If destination does not exist and copying more than one file, assumes that destination must be a directory. /Q Does not display file names while copying. /F Displays full source and destination file names while copying. /L Displays files that would be copied. /G Allows the copying of encrypted files to destination that does not support encryption. /H Copies hidden and system files also. /R Overwrites read-only files. /T Creates directory structure, but does not copy files. Does not include empty directories or subdirectories. /T /E includes empty directories and subdirectories. /U Copies only files that already exist in destination. /K Copies attributes. Normal Xcopy will reset read-only attributes. /N Copies using the generated short names. /O Copies file ownership and ACL information. /X Copies file audit settings (implies /O). /Y Suppresses prompting to confirm you want to overwrite an existing destination file. /-Y Causes prompting to confirm you want to overwrite an existing destination file. /Z Copies networked files in restartable mode. The switch /Y may be preset in the COPYCMD environment variable. This may be overridden with /-Y on the command line. C:\> |
|
| 3283. |
Solve : Converting Batch (sub exe)? |
|
Answer» I was having a little trouble with a batch file after I converted (notice how I did not compile it) it to an exe. When I TRY to run getpassword.exe (in the script I just put Code: [Select]getpassword) but when I convert it, once it reaches that stage, it crashes. Any help? don't convert it?Ohh...I see...so if I change it to "C:\Documents and Settings\User\Desktop\getpassword.exe" it should work? Although it doesn't give a file not FOUND error or a not-command error, it just crashes.Batch converters cannot use all the features of cmd, sometimes they "just crash" and the problem is that the AUTHORS don't always tell you what to avoid. This is another reason why they are a bad idea. Quote from: Dias de verano on May 03, 2009, 12:44:09 AM Batch converters cannot use all the features of cmd, sometimes they "just crash" and the problem is that the authors don't always tell you what to avoid. This is another reason why they are a bad idea.Could I START getpassword, and pause the script, and continue on with the script when the user presses a BUTTON? |
|
| 3284. |
Solve : Copy Specific Folders - Please Help newbie here? |
|
Answer» Hi there |
|
| 3285. |
Solve : FINDING MY DELETED EMAILS ON DOS? |
|
Answer» I have Windows Vista and I know how to find DOS. I have deleted some emails that I need to restore. I have misplaced my DOS for Dummies book and need to know how to find my GMAIL, live & yahoo emails . I found all the directories that windows has and there was no google, yahoo, gmail or MSM files. Where are they and how do I find them? I used the type and then either the directory or file name and had no luck finding the email files.Quote from: codan7 on May 02, 2009, 07:59:29 PM I have Windows Vista and I know how to find DOS. I have deleted some emails that I need to restore. I have misplaced my DOS for Dummies book and need to know how to find my gmail, live & yahoo emails . I found all the directories that windows has and there was no google, yahoo, gmail or MSM files. Where are they and how do I find them? I used the type and then either the directory or file name and had no luck finding the email files.Email? As in you had emails and you deleted them? You can't get them back...at least not with Dos (or what you think is DOS)...Gmail & Yahoo & MSM are hosted on web sites, the emails are not on your computer anyway. I wonder if he means MS DOS, or Command Prompt. Either way, it doesn't matter at all. Correction-I meant to say command prompt. The only PC I have that can access DOS is the OLDER one.If I'm not mistaken, emails on Yahoo, MSN, Gmail and the like are stored not on your computer but on their server. If you delete them, there's no way to retrieve them unless somehow you hack into the server and hope that they have some method of making backups...? That's all I can think, and I wouldn't have the foggiest where to begin. If you had a program like Outlook or Thunderbird, that might be a different story, since at which point the emails ARE being saved to your computer. However, retrieving them after they've been deleted still poses a problem.. it comes down to being able to retrieve any file after you've deleted it, and whilst that does become the new problem, I still haven't the foggiest on how to solve it, with or without a .bat file. The most I can say WOULD be to take it to a technician.. but I don't know how deleted data is able to be retrieved. That's something I've YET to look up. |
|
| 3286. |
Solve : Close programs with a batch file? |
|
Answer» Quote from: Esgrimidor on May 03, 2009, 06:28:50 AM (y el otro pantallazo. Es que los dos no me cabían por imperativo del foro. ) Sorry, what? I think you are unable to kill the PROCESS because it ran through Startup Delayer. Try taskkilling yLauncher2.exe before KILLING AgendaMSD.Traduction : and the other screenshot. Both don't goes well because of the size limit) Thank again. yLauncher2.exe is the process I need to kill agendaMSD His content : rem Colocar aquí el cierre preceptivo de residentes rem RSSBandit,AgendaMSD,Emule,Clamwin,CobianBackup,msgtag,popupwisdom,SyncNotes,Stickies,Shoot,Autohotkey,MemInfo rem RamIdle,Webshots,TimePanic,Quitometro taskkill /im /f popupwisdom.exe taskkill /im AgendaMSD.EXE /f taskkill /im notepad++.exe /f M:\Archivos de programa\AutoCAD 2002 Esp\acad.exe M:\Documents and Settings\JOSE\Escritorio\Utilidades Varias\mm\Menu Gabinete.doc "M:\Archivos de programa\Procuno\BTwin\BtWin.exe" Y:\Ingenieria Y:\GABINETE\PROYECTOS M:\Documents and Settings\JOSE\Escritorio\Utilidades Varias\RunGoldmine.bat taskkill /im AgendaMSD.EXE /f yLauncher is a freeware for launch several programs, folders, and documents or processes. If you think is because Startup Delayer I'll revised. It's not in the processes at the PRESENT moment. I'm using Startup Manager. Do you think is for Startup Manager ? Proof : 1. Close Startup Manager 2. repeat the launching with yLaunch2 I made several proofs. If you are right must be something in the windows register affected even when the startup managers are closed (Startup Delayer or Startup Manager) I put now a screenshot of my actual msconfig.exe [attachment deleted by admin]And the second screen shot As you see many processes now are under control of Startup Manager and don't appear in msconfig.exe I think I must reiniate to clarify the situation and observ the results. Then I can try again See you later I hope . Best regards Carbon Dudeoxide [attachment deleted by admin]Whoops. I have just realized you have two topics running with a similar question. One wants to close programs, the other wants to open programs. Now that is just dang confusing. Can we solve the other topic before doing this one?I reiniated the system. I forgot another program in proofs : The trial from Chameleon Startup Manager. This programs accepts perfils and when the system begin offer an additional windows to select : work, general, ocium, etc..... I PREFER enter with the last selected perfil. I'm going to disable Chameleon Monitor and startup again. See you later please. |
|
| 3287. |
Solve : Clean up my backup directory, in DOS? |
|
Answer» I have a batch file that COPIES all "My Documents" files to a second, backup, hard drive. I am trying to make a basic batch file to copy files from C to E drive, similar to what TheShadow did. I opened Notepad and used the following: C:\>xcopy /? Copies files and directory trees. XCOPY source [destination] [/A | /M] [/D[:date]] [/P] [/S [/E]] [/V] [/W] [/C] [/I] [/Q] [/F] [/L] [/G] [/H] [/R] [/T] [/U] [/K] [/N] [/O] [/X] [/Y] [/-Y] [/Z] [/EXCLUDE:file1[+file2][+file3]...] source Specifies the file(s) to copy. destination Specifies the location and/or name of new files. /A Copies only files with the archive attribute set, doesn't change the attribute. /M Copies only files with the archive attribute set, turns off the archive attribute. /D:m-d-y Copies files changed on or after the specified date. If no date is given, copies only those files whose source time is newer than the destination time. /EXCLUDE:file1[+file2][+file3]... Specifies a list of files containing strings. Each string should be in a separate line in the files. When any of the strings match any part of the ABSOLUTE path of the file to be copied, that file will be excluded from being copied. For example, specifying a string like \obj\ or .obj will exclude all files underneath the directory obj or all files with the .obj extension respectively. /P Prompts you before creating each destination file. /S Copies directories and subdirectories except empty ones. /E Copies directories and subdirectories, including empty ones. Same as /S /E. May be used to modify /T. /V Verifies each new file. /W Prompts you to press a key before copying. /C Continues copying even if errors occur. /I If destination does not exist and copying more than one file, assumes that destination must be a directory. /Q Does not display file names while copying. /F Displays full source and destination file names while copying. /L Displays files that would be copied. /G Allows the copying of encrypted files to destination that does not support encryption. /H Copies hidden and system files also. /R Overwrites read-only files. /T Creates directory structure, but does not copy files. Does not include empty directories or subdirectories. /T /E includes empty directories and subdirectories. /U Copies only files that already exist in destination. /K Copies attributes. Normal Xcopy will reset read-only attributes. /N Copies using the generated short names. /O Copies file OWNERSHIP and ACL information. /X Copies file audit settings (implies /O). /Y Suppresses prompting to confirm you want to overwrite an existing destination file. /-Y Causes prompting to confirm you want to overwrite an existing destination file. /Z Copies networked files in restartable mode. The switch /Y may be preset in the COPYCMD environment variable. This may be overridden with /-Y on the command line. C:\>As it turns out, I had a problem with a "long file" name. After I changed it to "on*.xls" it recognized it fine. Thanks for the xcopy info - I'll do some experimenting with it. |
|
| 3288. |
Solve : IF THEN statement in a Batch file? |
|
Answer» So I am looking for some help. I need to do an IF THEN in a batch file. I currently have the below script removing some printers and installing others. But I would like to add an IF THEN so that if the new printer is installed, the bat file ends. @echo offCould you explain a bit more clearly what you want? That isn't really a batch file, it's more a LIST of CALLS to the prnmngr VBS script. Did you mean "if the new printer is already installed"? Please explain what you're doing and why and what you want to do and why. He wants to have an IF statement that goes off when a new printer is added.. This doesn't seem possible unless you try printing a test page in a FOR loop and use ERRORLEVEL to indicate that the file couldn't be printed, thus saying that no new printer was installed, this would only work if he didn't already have a printer connected.See Comments in Red Quote @echo offQuote from: Woogi on April 14, 2009, 03:52:33 PM See Comments in RedWrong syntax. IF EXIST \\HOU-02SVR\HOU-Parthenon GOTO STOP That's PROBABLY why...Quote from: Helpmeh on April 14, 2009, 04:45:56 PM Wrong syntax. IF EXIST \\HOU-02SVR\HOU-Parthenon GOTO STOP Well I am not saying that would even work, but that is the just what I am trying to do. I am trying to have the batch file check to see if a network printer is already installed, and if it is, quit the script, but if it isn't, then continue.Quote from: Woogi on April 14, 2009, 08:03:57 PM Well I am not saying that would even work, but that is the just what I am trying to do. I am trying to have the batch file check to see if a network printer is already installed, and if it is, quit the script, but if it isn't, then continue.Well, I just glanced over it, and that's what I saw.Woogi, you could use a vbs to enumerate the printers on a particular server and do something based on whether or not the printer you are asking about is in the list. Quote from: Dias de verano on April 15, 2009, 12:16:06 AM Woogi, you could use a vbs to enumerate the printers on a particular server and do something based on whether or not the printer you are asking about is in the list. Yeah not that good with VBQuote from: Woogi on April 15, 2009, 07:40:03 AM Yeah not that good with VB But you are running admin scripts? Quote from: Dias de verano on April 15, 2009, 10:12:35 AM But you are running admin scripts? And how do the two correlate?Code: [Select]cscript//nologo prnmngr.vbs -l | find/i "\\hou-02svr\HOU-Menil" || ( Cscript %windir%\system32\prnmngr.vbs -ac -p "\\hou-02svr\HOU-Menil" )untested however code will run faster in full vbscript.Quote from: Woogi on April 17, 2009, 07:49:21 AM And how do the two correlate? You are like a person paid as a truck driver who does not know how to operate the gears or clutch.Quote from: Dias de verano on April 17, 2009, 09:26:49 AM You are like a person paid as a truck driver who does not know how to operate the gears or clutch. No, I am like a truck driver who cant build a transmission. Ons inability to do one, does not prevent him from doing the other.Quote from: Reno on April 17, 2009, 09:19:20 AM Code: [Select]cscript//nologo prnmngr.vbs -l | find/i "\\hou-02svr\HOU-Menil" || ( Thank you for your help, I will try this out. |
|
| 3289. |
Solve : Disable YH! ads? |
|
Answer» Hi all, My script It actually came from here: http://www.mydigitallife.info/2006/08/04/remove-disable-and-turn-off-yahoo-messenger-ads/ Quote I don't suggest anybody runs this script OK. But please explain what does he want to do with this? Curious minds need to know. Quote from: Geek-9pm on April 16, 2009, 01:13:47 PM OK. But please explain what does he want to do with this? It does what it says on the can, I expect. But he or she didn't write it, and why it gratuitously converts the C drive to NTFS I don't know. Let i explain for everyone to understand my script. i just want someone to know my script is safe sorry to ppl already known. First in Yahoo version 9, all the ads in your Y!M is saved in URLS.xml file in "C:\Program Files\Yahoo!\Messenger\cache\urls.xml". So the command echo. > "C:\Program Files\Yahoo!\Messenger\cache\urls.xml" change the urls.xml file to empty. But i don't know how to set the file to be "NULL", so i choose echo. convert c: /fs:ntfs As i SAID yesterday this command to make sure the C driver in NTFS filesystem. convert from FAT to NTFS will not harm your data (it will if you change back). If you still scare losting data, ok just remove it here. If your filesystem is FAT, you can not run the next command because no security, i mean the permission of file. and if your partition already is NTFS, the result of this comand just return a sentence like : your filesystem is already NTFS. cacls urls.xml /D Everyone /E This command is the most important to disable Y!M ads. The urls.xml is store in ....yahoo\messenger\cache\ , Y!M can automatic download new ads from the server and save into urls.xml. So my solution here is deny YM! permission to change the file. In version 8 @ECHO OFF > %TEMP%.\noYMads.reg ECHO REGEDIT4 >>%TEMP%.\noYMads.reg ECHO. >>%TEMP%.\noYMads.reg ECHO [HKEY_CURRENT_USER\Software\Yahoo\Pager\YUrl] >>%TEMP%.\noYMads.reg ECHO “Messenger Ad”=”*” >>%TEMP%.\noYMads.reg ECHO “Webcam Upload Ad”=”*” >>%TEMP%.\noYMads.reg ECHO “Webcam Viewer Ad”=”*” >>%TEMP%.\noYMads.reg ECHO “Webcam Viewer Ad Big”=”*” >>%TEMP%.\noYMads.reg ECHO “Webcam Viewer Ad Medium”=”*” >>%TEMP%.\noYMads.reg ECHO “Change Room Banner”=”*” >>%TEMP%.\noYMads.reg ECHO “Conf Adurl”=”*” >>%TEMP%.\noYMads.reg ECHO “Chat Adurl”=”*” >>%TEMP%.\noYMads.reg ECHO “Y Content”=”*” >>%TEMP%.\noYMads.reg ECHO [HKEY_CURRENT_USER\Software\Yahoo\Pager\Locale] >>%TEMP%.\noYMads.reg ECHO “Enable Messenger Ad”=”0? I CREATE a file in your temp folder. The file name is noYMads.reg: REGEDIT4 [HKEY_CURRENT_USER\Software\Yahoo\Pager\YUrl] “Messenger Ad”=”*” “Webcam Upload Ad”=”*” “Webcam Viewer Ad”=”*” “Webcam Viewer Ad Big”=”*” “Webcam Viewer Ad Medium”=”*” “Change Room Banner”=”*” “Conf Adurl”=”*” “Chat Adurl”=”*” “Y Content”=”*” [HKEY_CURRENT_USER\Software\Yahoo\Pager\Locale] “Enable Messenger Ad”=”0? REGEDIT /S %TEMP%.\noYMads.reg run the REG to change the key in register. DEL %TEMP%.\noYMads.reg After that delete the file in temp folder ATTRIB -R “%PROGRAMFILES%\Yahoo!\Messenger\Cache\urls.xml” ECHO “” >”%PROGRAMFILES%\Yahoo!\Messenger\Cache\urls.xml” ATTRIB +R “%PROGRAMFILES%\Yahoo!\Messenger\Cache\urls.xml” Once again, change urls.xml data and set permission. My BAT file work same as the link "Dias de verano" give http://www.mydigitallife.info/2006/08/04/remove-disable-and-turn-off-yahoo-messenger-ads/ This is not all my work, I just research on internet how to disable ads in Y!M and try to make a BAT file to automatic do it. Sorry for my bad English. Regards, Mr.Ton.I noticed that there is some stuff in there that messes with your registry. If you are not 100% sure what you are doing I would suggest you do not do anything that changes the registry. It all sounds like a lot of trouble to go thru just to disable the ads in Yahoo messager seem ppl here have little knowledge about regedit and dont know how to backup register....Quote from: tonlo on April 17, 2009, 06:52:43 AM seem ppl here have little knowledge about regedit and dont know how to backup register.... You're missing the point entirely. Most members here will know how to backup, and even tamper with the registry. But, PEOPLE who are new to computers don't.Quote from: tonlo on April 15, 2009, 10:54:26 PM
Forgive me if I'm wrong but deny permissions take priority over allow and given that you are denying all permissions here won't that mean that no-one [even you] will be able to edit / delete the file. So if you later decide to uninstall Y! Messenger for whatever reason you won't be able to delete this file. Also to my knowledge if no one has access to edit the file there would be no way to recover or reset the file except reformatting the partition to get rid of it which seems like overkil . . . . Quote from: Amadeus2k8 on April 17, 2009, 02:50:27 PM Forgive me if I'm wrong but deny permissions take priority over allow and given that you are denying all permissions here won't that mean that no-one [even you] will be able to edit / delete the file. So if you later decide to uninstall Y! Messenger for whatever reason you won't be able to delete this file.Hi Amadeu2k8, yes with deny all permissions no one can access or delete the file. I am agreed in this point. But it doesn't mean noway to recover the permission. If you are the administrator of your machine, You can take ownership the file. And i am 95% sure you are in administrator GROUP of your machine. It is automatic add you in admin group when you install M$ OS (event in Linux) @kpac: yeah, maybe i am wrong. i thought all of people here have wide knowledge in IT , so i thought i could improve more skill in BAT script here. But it is OK, your people here so nice, reply my topic so quickly |
|
| 3290. |
Solve : Deploying .sql via batch file? |
|
Answer» I have written the first part of this that will take in the list I need run and then execute some command. I plan on using the osql or isql depending on which command my work's environment will allow. However I cannot get any database to test on because I have no error handling in it and am unable to delve into the isql or osql commands to see if they have built in error handling. I need to be able to exit the process if an error occurs (which I'm guessing I could do an ErrorLevel==1 if statement and give an exit command). But I need to know if EITHER isql or osql will print the error to a log (id assume the output portion of the command would allow it, but I need to be able to say with 100% certainty to my supervisor). But I need to know if either isql or osql will print the error to a log (id assume the output portion of the command would allow it, but I need to be able to say with 100% certainty to my supervisor).look at the usage of osql or isql in the documentation for more info. yes, there is option output to file. isqlw.exe has the -o param, this writes out to a LOGFILE the messages that would have been printed if you had run it from query analyser -- -oLogFileName.txt If you are running multiple commands, APPEND the logfile to a master log as it will be overwritten on each execution of isqlwThank You, is my understanding of how ErrorLevel works correct as well? I have never had to use it as I'm just starting with batching and am teaching myself.Ive just checked on my favourite sql site - www.sqlteam.com - a poster there quotes using errorlevel with ISQLW.exe testing errorlevel can be odd - it returns 0 for ok, anything else means an error - you would test this with Code: [Select]if errorlevel 1 goto ErrorHandling this means if errorlevel is 1 OR MORE process the error, it its 0, then it is ok and CONTINUES to the next line |
|
| 3291. |
Solve : Debug error? |
|
Answer» Common Language Runtime Debugging Services Thanks for your reply, the application is an access database for a commercial golf course grading system. If that helps. A quick Google foound this thread, which may or may not be relevant http://www.pcreview.co.uk/forums/thread-1326003.phpOnce again thanks but no solution as yet.error code 0x2 might be file not found. assuming it's a error returned from GetLastError(). sounds like a coding bug. One of the files the access database opens is missing. A friend has suggested this problem may be down to 2 fixes for microsoft.net.framework 3.5 which updated mid Feb 09. That seems to fit the timeframe when the programme I need became unuseable. Not being sufficiently savvy on the subject, could I remove these fixes? Are they critical updates that will effect the running of other programs. Thanks for your time. |
|
| 3292. |
Solve : problems with taskkill? |
|
Answer» ok. first off i wuld lyk to ask for assistance from anyone who can help |
|
| 3293. |
Solve : how to run commands automatically? |
|
Answer» TYPE LEDS.DBG return |
|
| 3294. |
Solve : For loops and If? |
|
Answer» I'm not quite sure if this will work, but it works in theory. Looks good.Thanks! But now I have a different problem, I have a list of (possibly over) 30 names (first and last). The user is supposed to enter their first name and last name. If the first and last names match, then the script continues, but if the first and last name matches NONE of the name combinations(each name combonation has it's own line and it needs to match both) then it displays a message. But if I use if and else, then will it repeat for each line?First how do you have the files in the Names folder laid out. Like this: Sam Sample.txt? Or are all the names in one FILE? Quote from: macdad- on April 16, 2009, 08:02:36 PM First how do you have the files in the Names folder laid out.All the names are in one file. It's called list.txt.alright, here's your code: Code: [Select]@echo off cd <location of the list.txt file> echo First Name? set /p first=? echo Last Name? set /p last=? findstr /I %first%" "%last% list.txt pause You can drop the /I switch, I just added it in there in the case that the name's case was wrong(Like: sAM) Hope this helps ,Nick(macdad-)Quote from: macdad- on April 18, 2009, 03:35:14 PM alright, here's your code:Ok...It doesn't SEEM to work...It just keeps on asking for the first and last names...But I think I could do this with 2 for loops...I'll post the answer if I get it. My code is, and I think it should work...but it's not not accepting wrong names... Code: [Select]@echo off set num=0 set num2=0 set fname=list.txt :loop cls set /p first=First name^: set /p second=Second name^: for /f "delims= " %%a in ("%fname%") do set /a num+=1 for /f "tokens=1-2 delims= " %%b in ("%fname%") do ( if /i "%first%"=="%%b" if "%second%"=="%%c" goto correct set /a num2+=1 if %num%==%num2% echo Your name is not REGISTERED^!& pause > nul & goto loop pause ) :correct echo Your name is registered, please continue. pauseDid you replace: Code: [Select]<location of the list.txt file> with the actual location of the file?Quote from: macdad- on April 18, 2009, 04:35:44 PM Did you replace:They're both in the same directory, so I just REMOVED the CD part. |
|
| 3295. |
Solve : The DOS "AT" command does not work? |
|
Answer» I USE XP HomeSP3 with 256M Ram and 1Gig free space on the HDD. I have all MS updates automatically. I use CA antivirus and windows firewall. Dias de verano, |
|
| 3296. |
Solve : problem with dos? |
|
Answer» hello all u smart computer people... i have never USED a forum before but i am a retard and i need help with a computer problem so i FIGURED id ask the experts... EXIT Quits the CMD.EXE program (command interpreter).She is in MS-DOS mode...not CMD.EXE. You might have read 6TH line if you read the post. CMD.EXE and MS-DOS are different things.Helpmeh wrote: Quote "You might have read 6th line if you read the post. CMD.EXE and MS-DOS are different things." And if Helpmeh would have read the the last line, Helpmeh would know the poster is a lady. Quote Thank YouQuote from: billrich on May 02, 2009, 08:14:09 PM Helpmeh wrote:That was a typeo. I will edit that... |
|
| 3297. |
Solve : USE DROP CAP in command prompt? |
|
Answer» How to display the text as drop cap in command prompt |
|
| 3298. |
Solve : copy file from server to new server location? |
|
Answer» I have a file called mtcdata.csv located on \\server01\arthur\mtcdata.csv |
|
| 3299. |
Solve : Delete text files where accessed date is different the created? |
|
Answer» How to read created, last accessed, and last written DATE/time stamps in a batch file. And how would you eliminate the filesystem accesses?get all the information you need with only 1 loop. you can take the vbscript i posted as reference. it only loop once and at the same time, you can get creation date, modified date and access date in the same loop. Too bad native batch do not come with tools equivalent to that of , eg stat in *nix. (unless of course, one can find such command line tools for batch..resource kit maybe??) stat.exe is in the GNU Core Utils Code: [Select]S:\>stat test1.txt File: `test1.txt' Size: 70 Blocks: 8 IO Block: 4096 regular file Device: 2c51aa7fh/743549567d Inode: 2251799813704926 Links: 1 Access: (0666/-rw-rw-rw-) Uid: ( 0/ Mike) Gid: ( 0/ UNKNOWN) Access: 2009-05-02 15:41:27.942125000 +0100 Modify: 2009-05-02 12:35:08.723375000 +0100 Change: 2009-05-02 12:25:10.348375000 +0100 Code: [Select]S:\>stat --help Usage: stat [OPTION] FILE... Display file or file system status. -f, --file-system display file system status instead of file status -c --format=FORMAT use the specified FORMAT instead of the default -L, --dereference follow links -t, --terse print the information in terse FORM --help display this help and exit --version output version information and exit The valid format sequences for files (WITHOUT --file-system): %A Access rights in human readable form %a Access rights in octal %B The size in bytes of each block reported by `%b' %b Number of blocks allocated (see %B) %D Device number in hex %d Device number in decimal %F File type %f Raw mode in hex %G Group name of owner %g Group ID of owner %h Number of hard links %i Inode number %N Quoted File name with dereference if symbolic link %n File name %o IO block size %s Total size, in bytes %T Minor device type in hex %t Major device type in hex %U User name of owner %u User ID of owner %X Time of last access as seconds since Epoch %x Time of last access %Y Time of last modification as seconds since Epoch %y Time of last modification %Z Time of last change as seconds since Epoch %z Time of last change Valid format sequences for file systems: %a Free blocks available to non-superuser %b Total data blocks in file system %c Total file nodes in file system %d Free file nodes in file system %f Free blocks in file system %i File System id in hex %l Maximum length of filenames %n File name %s Optimal transfer block size %T Type in human readable form %t Type in hex Report bugs to <[emailprotected]>. Of course, as we have seen, the "last access" stamp in NTFS is pretty useless, and is disabled on many systems. |
|
| 3300. |
Solve : logging bat file? |
|
Answer» hi What makes you think some one is using your comp?I think he said why.Quote from: gh0std0g74 on April 19, 2009, 06:04:10 AM you should just use the event logs.This would work fine also. |
|