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.
| 5651. |
Solve : BATCH FILE + sleep command??? |
|
Answer» I have a batch file, and part of it, the user has the choice to either, shutdown, hibernate, logoff or sleep. I have all of the commands except for the sleep command...is there one? I have been un-able to find one @echo offThat's not how you spell "choice", and what happens after the set /p line if the user just presses ENTER? Or anything other than 1 to 5? Hi behzad-007, Since OP is using Win7 other than XP, I think it's better to use choice command. Because it's COMPLICATED to ensue user's legal input when using set /p command. Quote from: CN-DOS on August 14, 2011, 05:50:31 AM it's complicated to ensue user's legal input when using set /p command. No it isn't. At least not in this case. The use of quotes around the VARIABLES will avoid an error after a null input and a final GOTO after the tests for legal characters can redirect the user to make a further attempt. Code: [Select]:loop set/p ch="Your choice [1,2,3,4 or 5] >" if "%ch%"=="1" goto shutdown if "%ch%"=="2" goto restart if "%ch%"=="3" goto logoff if "%ch%"=="4" goto sleep if "%ch%"=="5" goto lock echo. echo Enter 1,2,3,4 or 5 only! echo. goto loop Quote No it isn't. At least not in this case. Yes, I agree. We do have METHOD to filter the input. But not your code. Did you tried input only a double quotation mark "Quote from: CN-DOS on August 14, 2011, 06:12:05 AM Yes, I agree. We do have method to filter the input. But not your code. Did you tried input only a double quotation mark " That's a good one. The sleep command that "behzad-007" gave me (rundll32.exe powrprof.dll,SetSuspendState 0,1,0) hibernates my computer! Is this ment to happen?? Can SOMEONE please help me...the sleep commands I have been given hibernate my computer. I am running Windows 7They haven't been back in 7 years...Quote from: athman8 on April 04, 2018, 07:10:16 AM I use a batch file to start up a few of the programs I need running in the background. Up until now, I had used the pause command to execute it after some of the other start-ups finished. I would prefer to use the wait or sleep commands but they do not appear to be included in Windows 7.Anybody know how to put those commands back in, or a different method that achieves the same results?Timeout |
|
| 5652. |
Solve : Unable to ping a particular website? |
|
Answer» Using my LG Rebel phone running Android 5.1.1, I was able to ping the site. The site is ravib.com, the one posted. But, I was using a phone and not a PC. Here is the screenshot In case of error, the target host or an intermediate router sends back an ICMP error message, for example "host unreachable" or "TTL exceeded in transit". In addition, these messages include the first eight bytes of the original message (in this case header of the ICMP echo request, including the quench value), so the ping utility can match responses to originating queries.But that does not really tell you what is wrong with the site. It just tells you that the ping does not work. The objective is to see if the web site is up and doing normal HTML stuff. -Right? When piing does not work, you can use another kind of tool to verify the web site is working normally. You can find many in a Internet search. Verify website is online without ping. https://www.uptrends.com/tools/uptime https://www.pingdom.com/free http://dnscheck.pingdom.com/ https://community.spiceworks.com/topic/514573-connectivity-check-without-ping-test Not found in above search was: Network-Tools This is my favorite way to see if either the host server or my own website is down. It gives a detailed trace and also provides DNS information and WHOIS details. Quote from: Coco423 on March 02, 2018, 11:40:40 AM Using my LG Rebel phone running Android 5.1.1, I was able to ping the site. The site is ravib.com, the one posted. But, I was using a phone and not a PC. Here is the screenshot Screenshot clearly shows that there was no ping reply. 100% packet LOSS.Quote from: Coco423 on March 02, 2018, 11:40:40 AM Using my LG Rebel phone running Android 5.1.1, I was able to ping the site. The site is ravib.com, the one posted. But, I was using a phone and not a PC. Here is the screenshotI guess you do not understand how networking works. Your ping clearly shows 100% packet loss. Code: [Select]H:\>ping google.com Pinging google.com [172.217.6.110] with 32 bytes of data: Reply from 172.217.6.110: bytes=32 time=8ms TTL=50 Reply from 172.217.6.110: bytes=32 time=8ms TTL=50 Reply from 172.217.6.110: bytes=32 time=8ms TTL=50 Reply from 172.217.6.110: bytes=32 time=8ms TTL=50 Ping statistics for 172.217.6.110: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 8ms, Maximum = 8ms, Average = 8ms H:\>ping ravib.com Pinging ravib.com [69.172.237.220] with 32 bytes of data: Request timed out. Request timed out. Request timed out. Request timed out. Ping statistics for 69.172.237.220: Packets: Sent = 4, Received = 0, Lost = 4 (100% loss), H:\> Oh. Sorry. That was the first time I tried to ping, now know ping failed. Good to know. Thought packet lss meant something. Follow the ping...the ping reveals all... Keep trying.Quote from: PATIO on March 02, 2018, 06:37:48 PM Follow the ping...the ping reveals all...I thought I was supposed to follow the white rabbit.1 pill MAKES you larger...Quote from: patio on March 02, 2018, 07:46:56 PM 1 pill makes you larger... Yeah, I get those emails too Yeah, pssh, "This pill can make you larger". Seriously? I'm not a dwarf so why are you telling me this?It's from White Rabbit...just so you know.athman8 Welcome Aboard... You should start a new Topic so it can recieve the proper attention...Quote from: athman8 on April 04, 2018, 07:12:14 AM I have encountered an issue recently that I am unable determine the cause of. There is a website I needed to access and was unable to access it so I called the customer service department of the website's organization and they told me after some troubleshooting to TRY to open the website on a different computer. This suggestion worked. I was able to access it with no issue on another Windows 10 computer. In fact, I was able to access this website on my smartphone and a Macintosh computer that are all connected to the same network.Your comments have nothing to do with this question. We are talking about getting a PING response. Not whether the website loads in your browser. He's new... Go easy squash.... OK...apparently you didnt' get the hint....Posting priviledges restricted. patio. |
|
| 5653. |
Solve : Bootable Dos 6.22 CD? |
|
Answer» Is it possible to make a Bootable Dos 6.22 CD? I want to make Bootable cd with Dos 6.22 and all the programs I want on it to. That way I can show other what Dos look like. I would after it booted it would be on Floppy a: drive. I try to make it with PowerISO but couldn't do it or I didn't know how. And your goal of it being loaded in A: after using a bootable CD ain't gonna happen...I believe that if you create a bootable CD using 'floppy emulation' you would get an A: drive with the actual CD ISO files being on whatever letter MSCDEX takes. HOWEVER a LEGAL bootable FreeDOS CD I have found, http://pingtool.org/downloads/fd11src_live.iso boots into the CD part, Drive E:, on the system I tried it with, but you can go to an emulated floppy by typing A: and hitting ENTER. According to the El Torito specification, a 32-bit CPU PC BIOS will search for boot code on an ISO 9660 CD-ROM. The standard allows for booting in two different modes. EITHER in hard disk emulation when the boot information can be accessed directly from the CD MEDIA, or in floppy emulation mode where the boot information is stored in an image file of a floppy disk, which is loaded from the CD and then behaves as a virtual floppy disk. This is useful for computers built before about 1999, which were designed to boot only from floppy drive.Thanx for that info Salmon...I'm not going to sell, trade giveaway. I just to show people the old Dos and what it look like. I didn't know I was going to cause a problem beside I own all the Software in question. I just others. I'm 70 years old. Everyone have a good day.For what it is worth... Yes, somebody did do a boot up CD of DOS 6.22 and if you use it without a linseed you violate the Microsoft copyright. But FreeDOS is free. And you can use to make a bootable USB device. See the Rufus documentation. Or see this link: How to use Rufus to create a bootable USB drive to install (almost) any OS You will note that Rufus can use FreeDOS to make a USB stick bootable. Which one will work with CD and install on a Hard Drive? I do not use Windows just Linux. Quote CDROMCDROM “standard” installerYou don't have Rufus for Linux. Rufus is a windows program. See this: https://alternativeto.net/software/rufus/?platform=linux Quote UNetbootinThen thee is YUMI, which deserves special mention. YUMI – Multiboot USB Creator Quote IMPORTANT NOTES: Your USB drive must be Fat16/Fat32/NTFS formatted, otherwise Syslinux will fail and your drive will NOT Boot. NTFS may not work with every DISTRIBUTION but is required for storing files over 4GB. YUMI UEFI must use Fat32 format.That warning may also apply to other tools that make USB bookable devices. Yes, it is a multi boot thing, but it has to format the whole drive as one. I don't believe YUMI writes to CD. NI nver tried. . |
|
| 5654. |
Solve : How do I unpack the old DOS .IMG files ?? |
|
Answer» I have a whole bunch of games, they were in .IMG FORMAT, each file size is around 1.4MB, I assume they are the old Floppy image file ? |
|
| 5655. |
Solve : My startup files.? |
|
Answer» I am a Linux user and I am a lot older now so I wanted to GO back to the olds so I went to the basement and got my MS-Dos 6.22 stuff. I have INSTALL it to a 256mb USB here is Autoexec.bat and Config.sys files. I like to KNOW if I need to change anything or not. @echo offHere my Config.sys Quote DEVICEHIGH=C:\DOS\HIMEM.SYS /TESTMEM:OFFCan anyone help me?Here what I came up with. Autoexec.bat Quote @ECHO OFFConfig.sys Quote DEVICE=C:\DOS\HIMEM.SYS /TESTMEM:OFFBut it won't load in to high memory. What do I need to do? |
|
| 5656. |
Solve : backup batch file to recognize day names? |
Answer» QUOTE from: RonC on April 28, 2018, 10:19:37 AMSorry people, I may have screwed up and my celebration was premature. I tried the coding you suggested and it didn't work. Here is the code for my bat file:This code should have GIVEN you an error. You are missing a double quote for the comparison on Friday and Saturday. |
|
| 5657. |
Solve : Need help with a simple batch script? |
|
Answer» Quote from: patio on March 31, 2018, 02:04:26 PM It souunds to me that the work STAFF are giving him impossible tasks...this is for work as per the 1st post.Let me guess. A Government Agency? Thanks everyone for trying to help me solve this problem. The data was spit out of an OLDER version of measuring automated tool (CMM) in the form of picture and text PDF file. Since then they are MAKING the data available in excel which is manageable. My task is to extract numeric data from these old files - from the picture part of the pdf. The above strategy helps me do that manually through the sequence of conversions. I am looking for a way to automate the steps mentioned above. Hope this helps.PDF's can be converted into Excel forms... Or CSV...though i don't know if CSV's would be easier... I have the standard Acrobat and I can turn a fully pictured pdf into an ugly excel file. But since all these CMM pdf files were generated the same way, I can always go to the same row 35 and column 12 and extract the needed data from them. Hope this helps. I am sorry hasn't replied lately, got into another fire fighting project. But I am back. Appreciate any help and guidance.This is not an answer. This is a word of caution. There is a very string misconception with data generated by a computer. Many layman, even professionals, bveli9ve data from computer is perfect. Of course, that is not true. There is an old saying: "Garbage in, Garbage out." Automatic conversion of numerical from ONE format to another can lead to very harmful errors. Whit text, we humans often spot nonsense.That is a safegaurd that prevents use from publishing garbage. We numerical data we humans do not know if the data is correct or not. When a report or a graphic is the result of Excel numerical data, people tend to believe it is flawless. There have been some very bad financial disasters from bad data in spreadsheets. https://www.telegraph.co.uk/finance/newsbysector/banksandfinance/11518242/Stupid-errors-in-spreadsheets-could-lead-to-Britains-next-corporate-disaster.html Quote Almost one in five large businesses have suffered financial losses as a result of errors in spreadsheets, ACCORDING to F1F9, which provides financial modelling and business forecasting to blue chips firms. It warns of looming financial disasters as 71pc of large British business always use spreadsheets for key financial decisions.and... https://www.nytimes.com/2013/04/19/opinion/krugman-the-excel-depression.html Some has said that anybody who works with spreadsheets needs to be carefully vested as to sanity and soundness of mind. Just a warning. Will it help if you can convert the PDF to TXT file on the command line? If so, you can use Ghostscript to do this https://www.ghostscript.com/download/ For example to create an output file pdf-output.txt from input file pdf-sample.pdf Code: [Select]gswin64c -sDEVICE=txtwrite -o pdf-output.txt pdf-sample.pdf |
|
| 5658. |
Solve : Big Plea. Can anyone help on finishing off a script as completely confused ....? |
|
Answer» Hi |
|
| 5659. |
Solve : Keep getting Variable is undefined.bat error anyone got any ideas why?? |
|
Answer» Hi |
|
| 5660. |
Solve : Extract Image? |
|
Answer» I have some Dos program's I converted back in the 90's but I can't remember what I used and I want to use again. I just found this and I will give it a try. http://www.winimage.com/extract.htm The maker of Winimage.You said in your first post that you wanted to do it on Linux. If you Google SEARCHED at all, you should be ABLE to do it with the good ole MOUNT command.Gimp runs on many Linux distros...Quote from: patio on April 16, 2018, 04:17:53 PM Gimp runs on many Linux distros...Seems odd that Gimp would OPEN a disk image file.Disc image file.....ahhh. I read too QUICKLY...Thanx. |
|
| 5661. |
Solve : Can I set up a auto DOS / BATCH FILE? |
|
Answer» Hi Im trying to make is easy so just a click on a icon and Im thinking of a script or command that someone clicks on and asks what subfolder they want to open within the folder and then asks for password thats on the subfolder and unzips as a complete folder to a specific location. Can be automated in the batch supplied to you where INSTEAD of a user given a choice of path and password entry, these fields could be set to static values so that once they click on the "icon" it runs and unzips automatically password protected file and does whatever else you want. Sorry about my caution in assisting with this, but as a system administrator yourself of this server, you should see how this could be easily used for wrong intent, and as a system admin you should have access to this said server so that this method of "others" running this on servers is not necessary. SOUNDS NEFARIOUS.....Topic Closed. |
|
| 5662. |
Solve : Re: phone dialer.? |
|
Answer» Quote == Could the Phone dialing and pre recorded call through computer. Not sure what you are asking for. Can you explain? If by chance you are looking for a way to DIAL out, using a dos program, then you might LIKE to CHECK out: http://en.wikipedia.org/wiki/Telix and http://www.telix.com/delta/deltacom/tfd/ |
|
| 5663. |
Solve : Help For 2nd time!? |
|
Answer» echo echo %%ENG%% = %%ENGX%% >> falures.txt >> glosor.bat |
|
| 5664. |
Solve : Help with bat2exe? |
|
Answer» Will someone please help me with bat2exe, i have no clue what to do with it.I ASSUME that you want to produce compiled versions of bat files
Why? Because if you don't and you leave bat2exe on the desktop, you have to type C:\docume~1\%username%\desktop\bat2exe.com batchfile.bat If you put it in system32 or where cmd.exe is, all you have to type is bat2exe.com batchfile.bat The reason why I dont USE bat2exe is because it doesn't support many commands. it keeps saying 'syntax ERROR' or 'unrecognized command' and stuff like that.Quote
The first time, you made it a blanket STATEMENT. Now it is conditional. Just wanted to clear that up. The statement, "You have to put bat2exe into the system32 folder.", is not good advice because it is not correct. Btw, "you have to type C:\docume~1\%username%\desktop\bat2exe.com batchfile.bat" is not correct either. Just navigate to that directory first. Quote You have to put bat2exe into the system32 folder.another way is to set the PATH env variable to where bat2exe is installed. don't really have to put it in system32Quote Because if you don't and you leave bat2exe on the desktop, you have to type C:\docume~1\%username%\desktop\bat2exe.com batchfile.batCan't you just drag the folder into the cmd.exe window, and the folder path will appear? yea fine..that works too....Basically to use bat2exe, put it on your desktop, open command prompt and type %userprofile%\desktop\bat2exe.com batchfile.bat and press enter and it will work.Quote Basically to use bat2exe, put it on your desktop, open command prompt and type %userprofile%\desktop\bat2exe.com batchfile.bat and press enter and it will work. As time goes by, and you experiment with various programs, you'll find that your desktop gets cluttered. I usually keep a directory just for playing around. Something like c:\testing Something like bat2exe would go in there, then when I open a 'dos' window it is quick and easy to cd to that directory. I'd do my testing from that directory, and not have to fool around with long command lines and environment variables. Much easier. When I find a utility program that I like and wish to keep handy, only then do I put it in my path. I do not think it is wise to have a lot of directories in the path, let alone the operating system limits on the path length. Having too many directories in the path just seems sort of sloppy to me, and eventually will yield some surprise results. Therefore, I make one directory for utility programs, and put it in the path. You can search here on CH for path , and find good reading on it. Something like bat2exe might find its way in there, assuming the program will behave properly when executed that way. For example, I keep pkzip.exe, pkunzip.exe, some other archivers, list.com, and fdate.exe in my "utils" directory, which is in the path. This kind of organization has served me well. It works, and files are not all over everywhere. I hope this helps. |
|
| 5665. |
Solve : TIME? |
|
Answer» so i was wondering is there a way to load TIME like infinite times like : |
|
| 5666. |
Solve : Need help in dos command? |
|
Answer» SORRY for my weak English how can I make a dos script to find the windows directory name from boot.ini ( i THINK find command) and set it as a variable ? (i think set command ) no HELP Quote from: Help Me on April 12, 2008, 04:28:21 PM how can I make a dos script to find the windows directory name from boot.ini Why do you want to do that? In WIN2K it's WINNT - in Win XP it's WINDOWS and the path/foldername is already Set in the environment variable %SystemRoot% - AFAIK boot.ini does not exist in Vista. what does your boot.ini look like now |
|
| 5667. |
Solve : how come this wont work?? |
|
Answer» This wont work: Use quotes to escape the spaces. like this ipconfig /all > "C:\Documents and Settings\Dakota\Desktop\dump\dump\DAKOTA-LAPTOP\ipconfig.txt" |
|
| 5668. |
Solve : Patch file for network registry? |
|
Answer» Dear all , Abo-Zead, Dear Squashman, I'm so sorry for your annoyance I did not mean that and I will take your advice in the next times. And If any one can help me please don't hesitate to explain the previous Post.Yes, it does need 'add' in each reg command - and will overwrite existing INFO, if I understood the help correctly. Code: [Select]@echo off set machine=192.168.0.100 set "key=HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" reg add \\%machine%\"%key%" /v AutoAdminLogon /t REG_SZ /d 1 /f reg add \\%machine%\"%key%" /v DefaultUserName /t REG_SZ /d EMO /f reg add \\%machine%\"%key%" /v Defaultpassword /t REG_SZ /d 123456 /f You will have to test it on a machine to confirm that it works before it can be modified, and also explain how you are getting the IP address of the machines - so the appropriate modifications can be made. Quote from: foxidrive on August 20, 2015, 04:04:23 AM Yes, it does need 'add' in each reg command - and will overwrite existing info, if I understood the help correctly. Ok, foxidrive I'll test this may be today or tomorrow and feedback you ASAP . but i think we can using the Hostname instead the IP and can use set "k=" , SET /P "K= and IF /i %K%== conditions to make the IP or Hostname is variable . and i can't understand what the meaning of /v , /t , /d and /f can you explain We appreciate you for your effort to help me Quote from: Abo-Zead on August 20, 2015, 07:41:05 AM but i think we can using the Hostname instead the IP Hostname should work - but are you typing in each hostname from the keyboard? Quote and i can't understand what the meaning of /v , /t , /d and /f can you explain In a cmd prompt type reg add /? and read the help and examples. If there is something you can't figure out then discuss which part you don't understand. Quote from: foxidrive on August 20, 2015, 09:15:41 AM Hostname should work - but are you typing in each hostname from the keyboard? Hi foxidrive, I have modified the Batch file as my requirements and when tested it gives me an error" invalid key name" and here is the final batch attached if you want to look and edit and the result. [attachment deleted by admin to conserve space]It requires the double quoting around the entire first term, not just %key% where I had put it. Test this on a non-critical machine. Code: [Select]@echo off set machine=cai3c332 set "key=HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" reg add "\\%machine%\%key%" /v AltDefaultDomainName /t REG_SZ /d CAI /f reg add "\\%machine%\%key%" /v AltDefaultUserName /t REG_SZ /d muslogon /f reg add "\\%machine%\%key%" /v AutoAdminLogon /t REG_SZ /d 1 /f reg add "\\%machine%\%key%" /v DefaultDomainName /t REG_SZ /d CAI /f reg add "\\%machine%\%key%" /v DefaultPassword /t REG_SZ /d esumiac /f reg add "\\%machine%\%key%" /v DefaultUserName /t REG_SZ /d muslogon /f reg add "\\%machine%\%key%" /v ForceAutoLogon /t REG_SZ /d 1 /f pauseQuote from: foxidrive on August 21, 2015, 04:10:38 PM It requires the double quoting around the entire first term, not just %key% where I had put it. Yes, MR foxidrive it's WORKING now many many thanks for your great effort with me. thank |
|
| 5669. |
Solve : Batch File/GP installation issue? |
|
Answer» Hello, That is the problem, yes, you cannot run recursive MSI installs, and that's enforced using a mutex, so the log shows that the second install cannot run because there is already one in progress.Thanks. Any idea how to modify a batch file so multiple computers don't try and run recursive msi's? It'd be good to know if the computers could see if the installer is in use, wait till it's done and then start the install so it doesn't fail with the mutex error?It may be that the batch script is installing multiple things and not waiting between different installs. Using the /wait switch with the start command may help. start "" /w "file1.msi" /switches start "" /w "file2.msi" /switches start "" /w "file3.msi" /switchesThere's brand loyalty for you! |
|
| 5670. |
Solve : Application/ Script for capturing continuous Trace route with Timestamp? |
|
Answer» Hello, |
|
| 5671. |
Solve : Batch file help - reformatting text? |
|
Answer» Hey all,
unless you are working with prehistoric machines with prehistoric OS, otherwise, yes vbscript can be used, from Win95/98 onwards. Here's one Code: [Select]Set objFS = CreateObject("Scripting.FileSystemObject") strFile = "c:\test\file.txt" s="" Set objFile = objFS.OpenTextFile(strFile) Do Until objFile.AtEndOfLine s=objFile.ReadLine & "," & s Loop WScript.Echo s save as script.vbs and on command line(batch) Code: [Select]c:\test> cscript /nologo script.vbs |
|
| 5672. |
Solve : download? |
|
Answer» I PURCHASED 2 cd discs but when i try to download them, the message |
|
| 5673. |
Solve : help iperf command? |
|
Answer» Hi, |
|
| 5674. |
Solve : Batch file problem, date and time don't show results.? |
|
Answer» Hello everybody. What's wrong with:That would be way to simple! |
|
| 5675. |
Solve : login script? |
|
Answer» previously i use this script on SERVER 2003 to map drive through network for clients PC. |
|
| 5676. |
Solve : Getting volume label name? |
|
Answer» Hello. Thanks for any help. I need some help in writing a batch dos command script that will check the name of the C: drive and if it does not match what I expect, will display a message. REASON is I have SEVERAL bootable harddrives in my system and when I boot up, I want to make sure I'm on the correct drive. Squashman's code will need a tweak if your label contains spaces. Code: [Select]for /F "tokens=5*" %%G in ('VOL C:') do set vol_label=%%HAnother method that works well is to put a FILE in the root with a unique filename and then check if that file exists. You can easily create a very small file with the command "echo > My_Disk". Not necessarily any better than using the VOLUME but simply an alternative.Quote from: strollin on September 09, 2015, 09:33:07 AM Another method that works well is to put a file in the root with a unique filename and then check if that file exists. You can easily create a very small file with the command "echo > My_Disk". Not necessarily any better than using the volume but simply an alternative.Yes. Definitely not the best alternative considering the security settings Microsoft puts in by default on the root of the C: drive now. Code: [Select]C:\>echo. >My_Disk Access is denied.I should have mentioned that you just need to do that from an Admin command prompt. |
|
| 5677. |
Solve : Rename nearly 21k files according to XML File? |
|
Answer» Hi Everyone, it looks for music file called AD0013046.wma It was an .mp3 file before! Hi, Sorry yes, MP3 was a mistake, they are all .wma filesThis was difficult because no parent node was shown in the sample XML. So I MADE one up called Music. There was also an error in the original script which has been corrected. Also the rename logic has been added. The script rename the AD files on disk using a combination of the artist and title name. The files are renamed on the disk. If you need to update the ID3 tag info let us know. Sample Test Data: Code: [Select]<?xml version="1.0" encoding="utf-8"?> <Music> <Song Artist="artist here " Title="thesongname here" SearchArtist="artist name" SearchTitle=" title" Styles="70s"> <Audio>13046</Audio> </Song> <Song Artist="Traffic" Title="The Low Spark Of High Heeled Boys" SearchArtist="Traffic" SearchTitle="The Low Spark Of High Heeled Boys" Styles="70s"> <Audio>66666</Audio> </Song> <Song Artist="Beatles" Title="Beatles VI" SearchArtist="Beatles" SearchTitle="Beatles VI" Styles="60s"> <Audio>45678</Audio> </Song> </Music> The is the new script: Code: [Select]Set xmlDoc = CreateObject("Microsoft.XMLDOM") Set fso = CreateObject("Scripting.FileSystemObject") xmlDoc.async = False xmlDoc.load("c:\temp\Songs.xml") Set colNodes = xmlDoc.getElementsByTagName("Music/Song") For Each node In colNodes Set colAttrib = node.attributes artist = colAttrib.getNamedItem("Artist").text title = colAttrib.getNamedItem("Title").text srchArtist = colAttrib.getNamedItem("SearchArtist").text srchTitle = colAttrib.getNamedItem("SearchTitle").text style = colAttrib.getNamedItem("Styles").text filename = "AD" & xmlDoc.getElementsByTagName("Audio").item(i).text & ".wma" WScript.Echo "Artist-" & artist WScript.Echo "Title-" & title WScript.Echo "Srch Artist-" & srchArtist WScript.Echo "Srch Title-" & srchTitle WScript.Echo "Style-" & style WScript.Echo "Filename-" & filename WScript.Echo"--------------------------------------------" Set f = fso.GetFile(filename) f.Name = artist & "-" & title & ".wma" i=i+1 Next Save this into the same folder where the songs and XML file live. Save with a VBS extension and RUN as cscript scriptname.vbs There might be some excessive code in the script. It will not harm anything. Recommend you test this out in a test directory before going live. Testing turned up no errors. Please help (1) i have one xml with lots many tags (2) i have many audio files with random generated number as a name and that name is in XML file (3) please tell me how can i rename those audio files with one of tag details present in xml file. i have to search that audio file as the name of the audio file is present in xml and under that section i will use one of the tag to rename it example - - Gambardella, Matthew XML Developer's Guide Computer 44.95 2000-10-01 An in-depth look at creating applications with XML. - Ralls, Kim Midnight Rain Fantasy 5.95 2000-12-16 A former architect battles corporate zombies, an evil sorceress, and her own childhood to become queen of the world. - Corets, Eva Maeve Ascendant Fantasy 5.95 2000-11-17 After the collapse of a nanotechnology society in England, the young survivors lay the foundation for a new society. - Corets, Eva Oberon's Legacy Fantasy 5.95 2001-03-10 In post-apocalypse England, the mysterious agent known only as Oberon helps to create a new life for the inhabitants of London. Sequel to Maeve Ascendant. - Corets, Eva The Sundered Grail Fantasy 5.95 2001-09-10 The two daughters of Maeve, half-sisters, battle one another for control of England. Sequel to Oberon's Legacy. - Randall, Cynthia LOVER Birds Romance 4.95 2000-09-02 When Carla meets Paul at an ornithology conference, tempers fly as feathers get ruffled. - Thurman, Paula Splish Splash Romance 4.95 2000-11-02 A deep sea diver finds true love twenty thousand leagues beneath the sea. - Knorr, Stefan Creepy Crawlies Horror 4.95 2000-12-06 An anthology of horror stories about roaches, centipedes, scorpions and other insects. - Kress, Peter Paradox Lost Science Fiction 6.95 2000-11-02 After an inadvertant trip through a Heisenberg Uncertainty Device, James Salway discovers the problems of being quantum. - O'Brien, Tim Microsoft .NET: The Programming Bible Computer 36.95 2000-12-09 Microsoft's .NET initiative is explored in detail in this deep programmer's reference. - O'Brien, Tim MSXML3: A Comprehensive Guide Computer 36.95 2000-12-01 The Microsoft MSXML3 parser is covered in detail, with attention to XML DOM interfaces, XSLT processing, SAX and more. - Galos, Mike Visual Studio 7: A Comprehensive Guide Computer 49.95 2001-04-16 Microsoft Visual Studio 7 is explored in depth, looking at how Visual Basic, Visual C++, C#, and ASP+ are integrated into a comprehensive development environment. (a)audio file name is >> bk101.mov which is defined as a book id in xml file , now i want to change it to computer.wav (which is in genre tag under book id tag of bk101) thank you You revived a 4 year old thread. You need to start your own thread. |
|
| 5678. |
Solve : Help with MSDOS batch files please? |
|
Answer» Years ago I was an expert with MSDOS batch files - but revisiting the subject from XP has given me an insoluble problem. |
|
| 5679. |
Solve : A little question? |
|
Answer» Quote from: ghostdog74 on April 12, 2008, 08:07:38 PM i presume you are learning how to program. if you are, choose a better language. I think TCL is an interesting language. Quote from: Dias de verano on April 13, 2008, 01:09:48 AM Quote from: ghostdog74 on April 12, 2008, 08:07:38 PMyes it is, and so are many OTHERS. Yes... my point is "whatever floats your boat"i presume you are learning how to program. if you are, choose a better language. umm im not learning. i know a little c++ delphi batch html and started for fun Just BASIC but i never used setlocal so i have problems with thatsince you have tried BASIC, how about a vbscript. CODE: [Select]For i=1 To 10 For J=1 To 10 For k=1 To 10 var1 = (i*i) + ( j*j) varR = k*k If varR = var1 Then WScript.Echo var1 & " " & varR & " " & k End If Next Next Next save as script.vbs and on command line Code: [Select]c:\test> cscript /nologo script.vbs hmm. i DONT know specialy vbs but i think i must be Code: [Select]For i=1 To 10 For j=1 To 10 For k=1 To 10 varl = (i*i) + ( j*j) var1 = i var2 = j varR = k*k If varR = varl Then WScript.Echo var1 & " " & var2 & " " & k End If Next Next Next and i dont need to do this c:\test> cscript /nologo script.vbs |
|
| 5680. |
Solve : help me pls...? |
|
Answer» Hello everyone. |
|
| 5681. |
Solve : Batch code problem; prevmonth=-1???? |
|
Answer» Hey guys, |
|
| 5682. |
Solve : hard drive crashed? |
|
Answer» hello. i was wondering if anyone could help me. i have a dell/gateway COMPUTER with windows ME and MS-DOS 6.0. my MOM said it crashed on her when she was playing a game, and i wasn't there when it happened. but when i turn on the computer, all i get is a file C that is totally USELESS...i tried getting bask to windows ME, but had no luck. all we have is a black screen with C:\>....or something like that. sorry. i don't REMEMBER what it says. |
|
| 5683. |
Solve : Batch File folder move? |
|
Answer» Let me start by saying, I'm VERY new to writing batch files. Here's my situation: |
|
| 5684. |
Solve : xcopy and "insufficient memory"? |
|
Answer» I made a simple series of batch files (SERIOUSLY, simple) to backup my flash drive. They worked for a while, but now the copying stops EARLY and "insufficient MEMORY" is displayed before the next file in the series (which prints the date in a text file) runs. |
|
| 5685. |
Solve : batch file solution? |
|
Answer» i want to create a batch FILE from command cmd " for %i in (user1 user2 user3 user4 user5) do net user /ADD %i " this command to create user windows as much as 5, what is the SOLUTION ? |
|
| 5686. |
Solve : Insufficient Memory with Xcopy on Win 7 of 750GB HDD 600GB data to 3TB ext drive? |
|
Answer» Trying to backup my Z: drive to an external and got a Insufficient Memory error using xcopy. Anyone know of a work around for this? Is there a way to see what file might be causing the condition etc. Microsoft Windows [Version 6.1.7601] System has 4 GB DDR2 RAM, and 2.3GB free with Windows 7 with Firefox and command shell running.Most likely cause is that one or more of the paths you tried to copy is longer than 254 characters. Workaround is to use Robocopy. Seems this has been asked before as well, and Salmon Trout gave effectively the same answer.If you are using xcopy with the /F switch you get logging on screen so you can see where the trouble starts. The problem can occur if the fully qualified name of either a source or POTENTIAL destination file exceeds 254 characters. As BC_P says, you can use Robocopy (Microsoft, free) or XXCopy (free for non-commercial use). There is also the "subst trick" where you substitute a spare drive letter for some part of a problem path e.g. subst z: \\myopenbsdbox\daily-backups\username\computername\C\. Quote If you are using xcopy with the /F switch you get logging on screen so you can see where the trouble starts. Thanks for the info. I wasnt aware of using the /F switch as a way to display error condition cause as for xcopy normally displays the files being transferred anyways and so I always thought the /F switch was useless. Was thinking I might have exceeded a maximum file size supported by xcopy vs path length. So Robocopy will allow exceeding the 254 character limit if thats the case here? I wasnt aware of that robocopy supported greater than 254 characters in path length. Quote Microsoft Windows [Version 6.1.7601]https://en.wikipedia.org/wiki/Robocopy Quote FeaturesThanks for the info on robocopy ... and 32,000 character length is insane...LOL Robocopy did solve the problem btw... thanks It's likely that with all the PC's you work on a 32,000 character limit is not out of the realm of possibilities... |
|
| 5687. |
Solve : HandbrakeCLI: use same target file name as source file name? |
|
Answer» Hi, In a batch file variables have percent signs before and after like this %filename%There are some others with exclamation marks but we don't need to go there right now. Sorry but you didn't understand what I mean (ENGLISH is not my first language). I use a media center software with infrared remote control. No keyboard. Inside this software I press a button to start handbrake. By pressing this button this commands will be send: handbrakecli.exe -i f:/videos -o f:/videos/movie.mkv "-i" means INPUT. "-o" means OUTPUT. So handbrake is searching for a TS file inside the folder "videos" and then encodes to mkv format. THe encoded movie gets the name "movie.mkv". That means: everytime I start an encoding process the mkv movie gets the name "movie.mkv". That's bad. ALso I can send this handbrakecli.exe -i f:/videos/hangover.ts -o f:/videos/hangover.mkv Thats means: handbrake only encodes the movie hangover.ts to hangover.mkv Now I need an automatically detection of the movie name. Something like this: handbrakecli.exe -i f:/videos/%filename%.ts -o f:/videos/%filename%.mkv But at this point the variable %filename% is empty. So: how can I prior to that store the the movie name in the variable %filename%. I think I need a batch that looks inside the folder "videos" for a movie in TS format and when there is a movie then the movie name needs to be STORED in the variable %filename%. But how can I acchieve this? olli14 The FOR command can list all the files in the directory. Code: [Select]FOR %%G in (*.ts) do echo %%G[code]To expand on Squashman's code: Code: [Select]@echo off FOR %%G in ("f:\videos\*.ts") do "handbrakecli.exe" -i "%%~G" -o "%%~nG.mkv"It's working great. Thanks. |
|
| 5688. |
Solve : identify & delete zero byte files from a directory? |
|
Answer» Hello. If anyone can help me with this issue: Zero byte fileIt goes on to say: Quote n some cases, zero byte files may be USED to convey information like file metadata (for example, its filename may contain an instruction to a user viewing a directory listing such as documents-have-been-moved-to-partition-D.txt, etc); or to put in a directory to ensure that it is nonempty, since some tools such as backup and revision control software may ignore the empty directories.The filename itself can be a for of metadata. Quote metadataBecause you are asking it too look at the directory and not any of the files in the directory. If the directory is empty it will be zerobytes and delete the directory. From the cmd prompt. Double the percent signs if you want to run this in a batch file. Code: [Select]H:\zerobyte>dir /a-d Volume in drive H is DATA Volume Serial Number is D2F3-49FA Directory of H:\zerobyte 07/22/2016 01:08 PM 1 onebyte.txt 07/22/2016 01:08 PM 2 twobyte.txt 07/22/2016 01:05 PM 0 zerobyte1.txt 07/22/2016 01:05 PM 0 zerobyte2.txt 07/22/2016 01:05 PM 0 zerobyte3.txt 5 File(s) 3 bytes 0 Dir(s) 124,020,506,624 bytes free H:\zerobyte>for %G in (\\SERVER\SHARE\Squashman\zerobyte\*) do @if %~zG equ 0 @echo delete %G delete \\SERVER\SHARE\Squashman\zerobyte\zerobyte1.txt delete \\SERVER\SHARE\Squashman\zerobyte\zerobyte2.txt delete \\SERVER\SHARE\Squashman\zerobyte\zerobyte3.txt H:\zerobyte>There's a script that runs on another system that places an error file into an ERROR_Logs folder. Many times, a zero byte file is generated. (I'm working on figuring out why this process is doing this.) I also have a UC4 monitor on this folder, that sends a notification if any files are in this folder for more than 1 hour. (another area where I'm trying to exclude zero byte files. In the mean time, I thought it would be easier to use a batch to delete any zero byte files, until the other STUFF can be sorted out. Hope this answers your question. Quote from: Geek-9pm on July 22, 2016, 09:59:40 AM Hello.Quote from: Geek-9pm on July 22, 2016, 09:59:40 AM Why would you want to do this? If a file has a least 1 byte, would it be somehow better or more useful? Geek, the task of deleting zero byte files is the very clear question and it's also clear that the OP has a reason to do so. Quote I'm trying to create a batch that will delete any files from a network drive that are Zero bytes. I chose to interpret that as every zero byte file on the drive. I added the recursive switch here and support for long filenames. Remove this portion if Squashman's code below shows the right things on your screen. @echo found filesize "%~zG" in file "%G" & @echo The same code will work for a single folder as in Squashman's post if you remove the /R switch and it is the double quotes around the "%G" that allows it to handle long filenames and long pathnames. Code: [Select]for /r %G in (\\SERVER\SHARE\*) do @if %~zG equ 0 @echo found filesize "%~zG" in file "%G" & @echo delete "%G" |
|
| 5689. |
Solve : Nested ifs and fried brain? |
|
Answer» I think I should know how to do this but I have forgotten too much of the nuances of the command prompt. I'm trying to dream up a condition statement for a host of possibilities, like deleting certain files but only those files. The first thought I had was along the lines of IF EXIST 000?.* DEL 000?.* ELSE - And that is where I am falling down on the job. To KEEP the example simple let's SUPPOSED an ascending list of in numeric order. So after the ELSE I would like to have it CHECK the next higher group as in IF EXIST 001?.* DEL 001?.* ELSE . . . . Basically I am wanting to build a really ugly next or compound IF statement. Now since this is supposed to happen in ascending or descending order it should be simple to just change the numerical condition if but I am stuck on this complex IF statement. I got out of the computer business about the time "scripts" were taking the PLACE of "Batch" files so Robo-powershell-whatever-it-is-called isn't really an option for me. I'd appreciate any suggestions. Some details. How many files? Why do you need to remove them? Would it not be better to send older files to a archive folder? Why sound sending order make any difference? Are you using IF EXIST before DEL filemask purely so that you don't get a 'file not found' error message if nothing matches filemask? Or is it important for some other reason to know if filemask exists? Will this affect what you do (or don't do) next? Because if your logic is like this: If any files matching filemask1 exist, delete them if not... If any files matching filemask2 exist, delete them if not... If any files matching filemask3 exist, delete them (etc) ... then you don't really care about the 'if nots', do you? Basically I'm asking, why do you need IF EXIST or ELSE at all? The folder in question has a few thousand graphic files and a program sequentially goes the folder and displays the next graphic in the list for a few minutes and goes to the next one. Unfortunately the program isn't bright enough to keep track of where it is in the list and after every restart, it starts with the first file. The files are all copies of files in a folder on a different drive so it is easy to replenish the folder "feeding" the program. For right now I attempt to remember to check that folder on a restart and delete out what seems like would be a reasonable number from the beginning. That way I don't have the same hundred files pictured over and over again. So I am looking for a way to delete some number of files, maybe a hundred, on a restart but without having to remember to do so. For example if file 0100 exists then I could delete 01?? but then I want it to stop. I don't want it to check for 0200 because I would have just deleted files 0100 through 0199. If after running the program for a while, deleting 100 files might seem too high or too low, then I could adjust the batch file IF statements accordingly. On the first running of the batch file it should FIND and delete the first hundred file and break out of the if statement. On the second running of the program it would find no matching files of the first hundred and skip to the next conditional statement; which would prompt about the next hundred and so on. By the time you have a thousand files deleted, the program would need to past through ten if statements which would all be not true but the eleventh one would be true. This is just an exercise in mental gymnastics to keep the brain from freezing up, it is not serious. But it has turned out to be tougher than I anticipated. I gave some consideration to reversing the logic to not exist but that didn't seem to make the task any easier. Quote from: rmmccoy On the first running of the batch file it should find and delete the first hundred file and break out of the if statement. On the second running of the program it would find no matching files of the first hundred and skip to the next conditional statement; which would prompt about the next hundred and so on. By the time you have a thousand files deleted, the program would need to past through ten if statements which would all be not true but the eleventh one would be true.This is what I did: 1. Create 1000 test files (I made .txt files but the extension is immaterial, you can change this) in blocks of 100 named 0000.txt to 0099.txt, 0100.txt to 0199.txt ... ending 0900.txt to 0999.txt 2. Each time it is run it deletes the first block in the sequence that exists, then quits. 3. If, on running, there are no files to delete, it informs the user and quits. If you run batches by double clicking in Explorer, (i.e. not in a console window) you may want to put a PAUSE command as the last line. @echo off IF EXIST 00??.txt DEL 00??.txt & goto done IF EXIST 01??.txt DEL 01??.txt & goto done IF EXIST 02??.txt DEL 02??.txt & goto done IF EXIST 03??.txt DEL 03??.txt & goto done IF EXIST 04??.txt DEL 04??.txt & goto done IF EXIST 05??.txt DEL 05??.txt & goto done IF EXIST 06??.txt DEL 06??.txt & goto done IF EXIST 07??.txt DEL 07??.txt & goto done IF EXIST 07??.txt DEL 07??.txt & goto done IF EXIST 08??.txt DEL 08??.txt & goto done IF EXIST 09??.txt DEL 09??.txt & goto done echo No files left! :done echo Finished The same effect is produced by this: @echo off FOR /L %%N IN (0,1,9) DO IF EXIST 0%%N??.txt DEL 0%%N??.txt & GOTO done ECHO No files left! :done ECHO Finished You can have multline IF statements using brackets (parentheses) so that this: IF EXIST 00??.txt DEL 00??.txt & goto done is equivalent to this: IF EXIST 00??.txt ( DEL 00??.txt goto done ) So you could do stuff like this IF EXIST 00??.txt ( ECHO Deleting files: 00??.txt DEL 00??.txt goto done ) Does the program take command line options at all? If so then keeping track of where a script is up to in the list of files should be fairly easy. Del can be tricky because when deleting using simple filemask it can delete files you don't want to delete, because del parses the short filenames too and not just the long filenames.Deleter4.bat: @echo off for /l %%N in (0,1,9) do if exist 0%%N??.txt echo Deleting files starting 0%%N00 & del 0%%N??.txt & goto done echo No files left! :done echo Finished Output of 11 runs, starting with a folder of 1000 files: D:\testfolder\del100>deleter4 Deleting files starting 0000 Finished D:\testfolder\del100>deleter4 Deleting files starting 0100 Finished D:\testfolder\del100>deleter4 Deleting files starting 0200 Finished D:\testfolder\del100>deleter4 Deleting files starting 0300 Finished D:\testfolder\del100>deleter4 Deleting files starting 0400 Finished D:\testfolder\del100>deleter4 Deleting files starting 0500 Finished D:\testfolder\del100>deleter4 Deleting files starting 0600 Finished D:\testfolder\del100>deleter4 Deleting files starting 0700 Finished D:\testfolder\del100>deleter4 Deleting files starting 0800 Finished D:\testfolder\del100>deleter4 Deleting files starting 0900 Finished D:\testfolder\del100>deleter4 No files left! Finished |
|
| 5690. |
Solve : How do I create a batch file script to run another batch file?? |
|
Answer» Hi all! I'm new to computer programming and command lines in batches, so please be patient with me. I'm trying to set up my computer so that my wife and kids can just turn it on, click on an icon, and PLAY any game they want. Thanks, but yes, I know that. I'm asking what the command lines I would use. This modification allows you to call the script below say gamerun.bat and in each shortcut for a game you can replace the target executable "c:\folder\gamefile.exe" with the line below and it should do the steps you want. This only requires the one gamerun.bat file but a side effect with a batch script in this way is that a cmd window will be on the taskbar during the gameplay. Code: [Select]%comspec% /c "c:\folder\gamerun.bat" "c:\folder\gamefile.exe" Code: [Select]@echo off Call "C:\Program Files (X86)\Windows Kits\10\Tools\x64\EnableXBOX1.bat" start "" /w %* Call "C:\Program Files (X86)\Windows Kits\10\Tools\x64\EnableAll.bat"Thanks guys... I had tried the Call command before, but it didn't work before and it still isn't working, and I have no idea why. To simplify things, I made a G drive file "DeviceManager" that holds devon.exe and EnableXBOX.bat. When I double-click on EnableXBOX.bat, I can tell it works, because it enables & disables the controllers as instructed. Then I made a bat file in a separate G drive file. The only script I included in it was this: Call "G:\DeviceManager\EnableXBOX.bat" So if I run that bat file, it should run the "EnableXBOX.bat" file the same as if I had run it directly, right? Only it doesn't. None of the controllers are enabled or disabled in accordance with the EnableXBOX.bat commands. I have no idea why the Call command in the second bat file isn't making the first bat file run. I'm going to try a work-around and just put the devcon.exe file in the same folder as the file with all my game SHORTCUTS. That way I shouldn't have to run a batch file from another batch file. But I wish I could figure out why I can't do this when it seems so simple. For what it's worth, I'm on Windows 10.Well, my work-around worked... sorta. For the Dark Souls game, I just put this batch together in the same folder as devcon.exe: @echo off devcon enable "{Xbox controller}" devcon disable "{the other HID controllers}" "G:\darksouls.exe" TIMEOUT /t 30 devcon enable "{the other HID controllers}" This works - when I click on this batch file, the game starts with the proper controller enabled and the others disabled, then after 30 seconds enables the other controllers (I do this to make sure the game starts). As long as the game starts with the other controllers disabled, the X360 controller still works. The only issue is that when the enable kicks in after the 30 seconds, it minimizes the game and shoots me back to my desktop. I know all I have to do then is click on the game icon again, but that's inelegant. Is there any way to have the script either execute the last instruction (1) after exiting the game, or (2) in the background, so it doesn't minimize the game? Thanks again for the help!!!Quote Then I made a bat file in a separate G drive file. The only script I included in it was this:Do you mean in a separate G drive folder? You need to put devcon.exe in that folder, or else include the full path to devcon.exe in EnableXBOX.bat. Otherwise it won't see devcon.exe. Ah - okay, I think that makes sense. Still, now I think I need more the answer to my other question - which is whether there's any way to have the script (1) disable the applicable controllers (which I now know how to do), (2) start the game (again, I now know how to do), then (3) enable the controllers without interrupting the game - either by waiting until exiting the game or by enabling them without minimizing the game. It's #3 that I can't seem to figure out. Thanks.Does it do that for all games or just selected ones? It's not a usual behaviour for command line tools and devcon itself may be the problem if all games do this. You can place devcon.exe on the path and it will work from any folder. C:\windows or c:\windows\system32 are fairly good spots for this. |
|
| 5691. |
Solve : set date in batch file,? |
|
Answer» Hi to hall. |
|
| 5692. |
Solve : Batch file to disable Daylight saving time for remote machine? |
|
Answer» This may help you: The Windows Time Zone Utility is available as a download from MS. You've made it very easy for me to check by providing the links - and those refer to downloads for XP (and server 2003). Just commenting here if people stumble across this thread looking for info in the future, that it's not for current versions of Windows. I do see that Abo-Zead is using XP though.Hope you can help him. In non-western countries, the DST is more difficult. Local conditions alter the way it is used. Microsoft is aware of the problem and has some information about how to fix it for Egypt this year. Last year: 2014 - Egypt Ramadan DST changes - Fix it This yer: 2015 - Egypt DST changes - hotfix I found these with a Google on: how does windows do DST in Egypt It seems many administrators in Egypt have issues with DST. Dear all, thank you for your assistance and APPRECIATE that and after explore some pages that you provide it to me i understood a little of things And I hope that you read my post carefully well So i'll explain my issue again ( all machines have synchronized with the server in time but some times some machines lost this syncing and enable daylight saving time I mean +1 hour but all machines have the same time zone even the machines that lost syncing ( Egypt Standard Time ) and and i want to return the time as before by disabling daylight saving time or by any way so i did restart it remotely to re-syncing and nothing happened and create the batch attached to disable DST and restart it remotely and also nothing happened, only the remote access can do that but i want to do that by using remotely batch. NOT: my created batch can disable DST for remotely machine but can't apply that actually as figures in the first post. : machines have Windows XP SP2. So Could any one create a batch to disable DST and apply that for remotely machine actually . thanks again for your supportThis may be of interest: http://www.timeanddate.com/worldclock/egypt/alexandria Alexandria, Egypt does not use the DST of Cairo. My guess is that Windows has some problem doing DST for Egypt. And remember that Windows XP is no longer supported by Microsoft. Therefore, you may have to set all machines to Alexandria, Egypt. Doing so should SHUT off the DST. I can not test this. Here is another reference: https://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/int_pr_custom_workspace_regionalsettings.mspx?mfr=true From there go to the place where is says: Change the way your computer displays the time Speculation: Setting the time off by twenty minuets may cause the machine to sync again with the server. Please keep us posted. EDIT: Try this Google search: https://www.google.com/search?q=force+remote+XP++to+not+use+DST&ie=utf-8&oe=utf-8 It seems the XP DST trouble is not limited to Egypt or any location. It is impossible to turn off DST in Windows XP by remote. One of the links mentions Egypt, but the problem is also in other places. http://itproafrica.com/technology/windows/disabling-daytime-savings-microsoft-windows-egypt-dst/ Dear all, could any one help me to do this code " TZUTIL /s "Pacific Standard Time_dstoff" in remotely machine. by batch file onlyQuote from: Abo-Zead on September 23, 2015, 10:18:44 PM could any one help me to do this code " TZUTIL /s "Pacific Standard Time_dstoff" in remotely machine. What remote access software can be used? PSEXEC? Edit: It looks like tzutil is not a tool that you can use on XP. https://technet.microsoft.com/en-us/library/hh825053.aspx Applies To: Windows 8, Windows 8.1, Windows Server 2012, Windows Server 2012 R2 |
|
| 5693. |
Solve : BAT file to Detect file size and rename? |
|
Answer» Hi, |
|
| 5694. |
Solve : Split big Dos/windows text file into smaller multiple Unix text files?? |
|
Answer» First of all i using WINDOWS OS and not LINUX,all i want is to Split a big file from Dos/windows text file into smaller multiple Unix text files?All tools i tried,they spliting from dos/windows format to dos or from unix to dos,i want a tool,a bat, a command line,anything to split from dos or unix to unix How do you want your files split? Foxi, you beat me to it. The dos/unix aspect makes me think of lines rather than merely blocks of characters. Rather more information required. |
|
| 5695. |
Solve : Batch file "hangs" when loading an .exe file.? |
|
Answer» First off hi everyone, new here. compiled .ahk scriptTell more about this, please. Can it be run without being compiled? Does it? If so, why compile it for a batch program? I've noticed that compiled Autoit scripts (a relative of AutoHotKey) take a few seconds to start up from a batch. It could be they are getting scanned by your antivirus each time. But that does not explain why your compiled AHK script is slower from batch than the prompt. For the benefit of OTHERS reading this. AutoHJotKey has been mentioned time and time gain on this forum. Just go to the search box on the top right and enter autohotkey and press enter. Over a hundred posts. Quote from: Geek-9pm on July 18, 2012, 02:43:45 PM Tell more about this, please. Sorry should have elaborated there, it's a basic scripting language that can do basic tasks (run, read / write from ini files) with an easily "coded" GUI. (Not to undersell it, it can do more advanced stuff). It can be run without being compiled but you have to have Auto Hot Key installed in order for it to operate and I am trying to make this for a few people and it would be easier if it was a self executing file. I have tried using different .exe (just as a test) and I still get the 5-10 second "hang" with this. Quote from: Salmon Trout on July 18, 2012, 03:01:25 PM I've noticed that compiled Autoit scripts (a relative of AutoHotKey) take a few seconds to start up from a batch. It could be they are getting scanned by your antivirus each time. But that does not explain why your compiled AHK script is slower from batch than the prompt. I think I have figured a work around after reading this. I will make another AHK execution file to do the "if NOT EXIST System\settings.ini (goto firstrun) else (goto start)" then make it either run the set-server.exe or run the original batch file. I think that should do that trick. |
|
| 5696. |
Solve : give information to user after on the computer? |
|
Answer» i used batch file to delete data from public every week . but i want to inform the users before two days .after the computer on,the first massage on screen SHOW automatically for the user. " pleas back up you data from public folder " how can i do that ? thanks in advance So you want to delete the files, and then 2 days later have them receve a message telling them to back up their data?Task Schedulersure Lemonilla do u have any idea ?
How to Use Task Schedulertanks Squashman. i used task scheduler to run batch file. and clean public folder, but what i said, how to send a massage for all users using task scheduler. Quote from: Mesafint on July 19, 2012, 01:33:04 AM tanks Squashman. i used task scheduler to run batch file. and clean public folder, but what i said, how to send a massage for all users using task scheduler.Since you stated that you run this batch file to clear out thee public folder weekly I have to assume you do it on a specific day of the week. So if you schedule it to run on Friday, have another SCHEDULED task that runs on Wednesday to give them the warning. |
|
| 5697. |
Solve : help a novice - trying to modify hosts file to pad ip with zeros? |
|
Answer» Trying to pad hosts file so sorting will work properly. Trying to pad hosts file so sorting will work properly.Hosts file does not need sorting. Quote from: Geek-9pm on July 17, 2012, 09:56:03 PM Hosts file does not need sorting.While that is true it may help the user manage a large hosts file. But I personally would sort the hosts file by the Domain name. Not the IP address. But there are plenty of 3rd party hosts file editors out there and I would bet some of them have the capability to sort the hosts file when it is viewing it.Quote from: Squashman on July 18, 2012, 05:43:25 AM While that is true it may help the user manage a large hosts file. But I personally would sort the hosts file by the Domain name. Not the IP address. But there are plenty of 3rd party hosts file editors out there and I would bet some of them have the capability to sort the hosts file when it is viewing it.Exactly!Am I missing something here? If you add 2 zeroes to a decimal byte at the beginning of a dotted quad IP address you clobber it, because Windows interprets numbers with leading zeroes as octal. (0074 octal is 60). Code: [Select]C:\>ping www.google.com Pinging www.l.google.com [74.125.132.104] with 32 bytes of data: Reply from 74.125.132.104: bytes=32 time=33ms TTL=46 Reply from 74.125.132.104: bytes=32 time=31ms TTL=46 Reply from 74.125.132.104: bytes=32 time=60ms TTL=46 Reply from 74.125.132.104: bytes=32 time=38ms TTL=46 Ping statistics for 74.125.132.104: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 31ms, MAXIMUM = 60ms, Average = 40ms C:\>ping 74.125.132.104 Pinging 74.125.132.104 with 32 bytes of data: Reply from 74.125.132.104: bytes=32 time=29ms TTL=46 Reply from 74.125.132.104: bytes=32 time=28ms TTL=46 Reply from 74.125.132.104: bytes=32 time=31ms TTL=46 Reply from 74.125.132.104: bytes=32 time=45ms TTL=46 Ping statistics for 74.125.132.104: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 28ms, Maximum = 45ms, Average = 33ms C:\>ping 0074.125.132.104 Pinging 60.125.132.104 with 32 bytes of data: Request timed out. Request timed out. Request timed out. Request timed out. Ping statistics for 60.125.132.104: Packets: Sent = 4, Received = 0, Lost = 4 (100% loss) Quote Am I missing something here? If you add 2 zeroes to a decimal byte at the beginning of a dotted quad IP address you clobber it, because Windows interprets numbers with leading zeroes as octal. (0074 octal is 60). Probably true, so why not use spaces for FIRST octet? This little piece of doggerel will show the mechanics of doing this, but as mentioned there is no reason to sort the Hosts file. Code: [Select]@echo off setlocal enabledelayedexpansion if exist sorted del sorted if exist unsorted del unsorted for /f "tokens=1-2*" %%i in (c:\windows\system32\drivers\etc\hosts) do ( for /f "tokens=1-4 delims=." %%r in ("%%i") do ( set "ip1= %%r" set "ip2=00%%s" set "ip3=00%%t" set "ip4=00%%u" echo !ip1:~-3!.!ip2:~-3!.!ip3:~-3!.!ip4:~-3! %%j >> unsorted ) ) sort /+1 unsorted /o sorted Be patient. Code runs at the speed of continental DRIFT. Note: if you change the sort key offset, you can sort on the domain name.Here is a discussion of this for UNIX http://www.madboa.com/geek/sort-addr/ The UNIX sort has more options that the Windows sort. Sorting IP address presents a challenge.This works here and handles lines with rems. The delims is set to dotTABspace and the TAB is required because Windows 7 at least converts hosts space delimiters to TABS. Input file is hosts.txt and output file is HOSTS Code: [Select]@echo off SETLOCAL ENABLEDELAYEDEXPANSION del *.tmp 2>nul FOR /F "tokens=1,2,3,4,* delims=. " %%a IN (hosts.txt) do ( set a=%%a set ip1= set ip2= set ip3= set ip4= if not "!a:~0,1!"=="#" ( set "ip1=00%%a" set "ip2=00%%b" set "ip3=00%%c" set "ip4=00%%d" echo !ip1:~-3!.!ip2:~-3!.!ip3:~-3!.!ip4:~-3! >>file.tmp echo !ip1:~-3!.!ip2:~-3!.!ip3:~-3!.!ip4:~-3! %%a.%%b.%%c.%%d %%e ) else ( >>file3.tmp echo %%a %%b %%c %%d %%e ) ) sort <file.tmp >file2.tmp FOR /F "tokens=1,*" %%b IN (file2.tmp) do ( >>file4.tmp echo %%c ) copy /b file3.tmp + file4.tmp hosts >nul del *.tmp pause endlocalModification to also cater for source files that do not contain any comment lines. Code: [Select]@echo off SETLOCAL ENABLEDELAYEDEXPANSION del *.tmp 2>nul FOR /F "tokens=1,2,3,4,* delims=. " %%a IN (hosts.txt) do ( set a=%%a set ip1= set ip2= set ip3= set ip4= if not "!a:~0,1!"=="#" ( set "ip1=00%%a" set "ip2=00%%b" set "ip3=00%%c" set "ip4=00%%d" echo !ip1:~-3!.!ip2:~-3!.!ip3:~-3!.!ip4:~-3! >>file.tmp echo !ip1:~-3!.!ip2:~-3!.!ip3:~-3!.!ip4:~-3! %%a.%%b.%%c.%%d %%e ) else ( >>file3.tmp echo %%a %%b %%c %%d %%e ) ) sort <file.tmp >file2.tmp FOR /F "tokens=1,*" %%b IN (file2.tmp) do ( >>file4.tmp echo %%c ) if exist file3.tmp ( copy /b file3.tmp + file4.tmp hosts >nul ) else ( move file4.tmp hosts >nul ) del *.tmp pause endlocal |
|
| 5698. |
Solve : Batch File copying text from one file to another cuts off at first space? |
|
Answer» Hi. I have a batch file to remove the last line of my .TXT file. In this case it copies all rows (except the last one) from d177920101id.txt Hi. I have a batch file to remove the last line of my .txt file. In this case it copies all rows (except the last one) from d177920101id.txtIf you read the help file for the FOR command you would have read this. Code: [Select]delims=xxx - specifies a delimiter set. This replaces the default delimiter set of space and tab.Thank you, that was extremely helpful. Adding "delims=" worked perfectly! |
|
| 5699. |
Solve : Date & Time naming of log files? |
|
Answer» I have several time and date routines too. You're thinking of Visual Studio. Well, VB6/VBA, as OPPOSED to VBScript, which doesn't have the Format Function apparently. |
|
| 5700. |
Solve : batch file to replace string? |
|
Answer» i working on a script that detect weird date in the FILE and replace them with yesterday date. here the raw data assuming yesterday date |
|