Explore topic-wise InterviewSolutions in .

This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.

5801.

Solve : Saving and resuming for batch RPG?

Answer»

Hey, I have began working on a batch RPG and I can't SEEM to find any information on how to make code where it saves where you left off, maybe like a resuming code, but I can't seem to find any INFO on that.It depends entirely on your RPG code - but essentially you can echo each variable into a text file and read the text file when you need to restore the variables.Say you had 3 variables called power, voltage and ENERGY

you could save them like this

if exist save.txt del save.txt
echo power=%power% >> save.txt
echo voltage=%voltage% >> save.txt
echo energy=%energy% >> save.txt

and read them back like this

for /f "delims=" %%A in (save.txt) do set %%A

5802.

Solve : DOS Search Replace Random Numbers?

Answer»

Good Day

I have a text file with random dates that are formatted like so


, 01 02 94
, 04 06 97
, 23 12 89

etc

I would like a way to have a dos BATCH seach for the dates and replace with the following

,01-02-94
,04-06-97
,23-12-89

There is a space between the , and the first number.
There are also lots of numbers in the text file besides these. So I need to search for the entire 9 or 10 characters. The number are random. The , and spaces are always the same.

I can do it in microsoft word with wild card searches with the following commands

Word
Find
(,)( )([0-9])([0-9])( )([0-9])([0-9])( )([0-9])

Replace
\1\3\4-\6\7-\9


BUt I need to be able to do it with a dos batch for a vbs script in windows.

Thank You
Are the dates always in the same place in each line? Is the text file formatted as CSV? Some examples of full LINES would be helpful.

Do you want every sequence of a COMMA + space + 3 number pairs separated by spaces treated as you have shown e.g. , 01 02 85 to ,01-02-85?


Examples

*Q,08 87,123.90,517, 01 07 98, 139.80,810 12
H,08 87,-123.90,0, 01 07 98, 139.80,810 12
*Q,09 88,34.50,517, 26 09 99, 142.90,710 34
H,09 88,-34.50,0, 26 09 99, 142.90,710 34
*Q,19 88,1232.50,517, 14 09 00, 1142.90,42010 56
H,19 88,-1232.50,0, 14 09 00, 1142.90,42010 56

the file is comma delimited. It is exactly the same amount of comma before the dates. But as you can see sometime it is more or less spaces away from start of line.

Hopes this helps

I would like it to look like

*Q,08 87,123.90,517,01-07-98, 139.80,810 12
H,08 87,-123.90,0,01-07-98, 139.80,810 12
*Q,09 88,34.50,517,26-09-99, 142.90,710 34
H,09 88,-34.50,0,26-09-99, 142.90,710 34
*Q,19 88,1232.50,517,14-09-00, 1142.90,42010 56
H,19 88,-1232.50,0,14-09-00, 1142.90,42010 56The date you wish to reformat is the 5th field in a comma delimited string, therefore.

This looks feasible. However, it is now 22:40 in my time zone, (my bedtime) and I have a job so expect more in 18-20 hours approx. Others may be able to respond before then.



I created a vbs script that can search and display the results

Set objRegEx = CreateObject("VBScript.RegExp")

objRegEx.Global = True
objRegEx.Pattern = ", (\d{2}) (\d{2}) (\d{2})"

strSearchString = "*Q,08 87,123.90,517, 01 07 98, 139.80,810 12"
strNewString = objRegEx.Replace _
(strSearchString, ",$1-$2-$3")

Wscript.Echo strNewString


How do i get this to read every line of a text file and replace it.



File name write.vbs

Const ForReading = 1
Dim objLog, objFile, objHost
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objHost = objFSO.OpenTextFile("test.txt", ForReading)
Set objLog = objFSO.OpenTextFile("test2.txt", 2, True)

Set objRegEx = CreateObject("VBScript.RegExp")

objRegEx.Global = True
objRegEx.Pattern = ", (\d{2}) (\d{2}) (\d{2})"

Do Until objHost.AtEndOfStream

strSearchString = objHost.ReadLine
strNewString = objRegEx.Replace _
(strSearchString, ",$1-$2-$3")

Set colMatches = objRegEx.Execute(strSearchString)

If colMatches.Count > 0 Then

For Each strMatch in colMatches

objLog.WriteLine strNewString

Next

End If

Loop

objHost.Close


This will read the first file and write to the second. It does what I need but it deletes any lines that dont have the matching values. Does anyone know how to keep the non matching values also.
This uses a native Windows batch script called Jrepl.bat written by dbenham
http://www.dostips.com/forum/viewtopic.php?f=3&t=6044

Place Jrepl.bat in the same folder as the batch file, or in a folder that is on the SYSTEM path.

There is also copy on Dropbox (unblock it after downloading): https://www.dropbox.com/s/4otci4d4s8x5ni4/Jrepl.bat

Code: [Select]@echo off
call jrepl ", ([0-9][0-9]) ([0-9][0-9]) ([0-9][0-9])," ", $1-$2-$3," /f "file.csv" /o -
pause
Thank You

This works perfectly

5803.

Solve : date compare?

Answer»

@ECHO OFF
@For /F "tokens=2,3,4 delims=/ " %%A in ('DATE /t') do @(
Set Month=%%A
Set Day=%%B
Set Year=%%C
@echo TODAY = %%B/%%A/%%C
)
@echo TODAY =%DAY%/%Month%/%Year%

02/03/2016

FOR /F "tokens=2 delims==" %%A in (C:\Table\location.txt do (
FOR /F "skip=1 tokens=1,7,8,9 delims=," %%S in (C:\Temp\Mylists\%%A.csv) do (
rem Day=%%V Month=%%U Year=%%T
echo %%A,%%S,%%V/%%U/%%T >> C:\Temp\test.csv
))

7/2/2016
1/3/2016

to compare date ( no time) if compare LEQ - less than or equal
How do I solve the problem with the leading Zero

ThanksThis will pad a number in a for variable

Code: [Select]if %%z LSS 10 echo 0%%zthanks foxidrive
but...


FOR /F "skip=1 tokens=1,7,8,9 delims=," %%S in (ariel.csv) do (
rem Day=%%V Month=%%U Year=%%T
echo DATE FOME READING FILE - %%V/%%U/%%T

csv file Date I do not have the option to change the file format
7/2/2016

@ if %%V LSS 10 echo 0%%V
@ if %%U LSS 10 echo 0%%U
echo is ok - But I should compare dates for today

I tried if %%U LSS set %%V=0%%V Without success

I have to compare less than or equal And it's still wrong
7/2/2016 LEQ 04/03/2016

frome file i get 7/2/2016
frome system 04/03/2016You need to juggle the dates into yyyymmdd order and that can easily be compared.

Without seeing the DATA it's hard to give code that is suitable.This is the output I get software that I can not change - csv file
When reading the file with the command LINE
date is Without leading Zero

I have to do EXACTLY what you wrote yymmdd
but I do not know how to do that with the command line
Get today's date and the date of the file in the same format



[attachment deleted by admin to conserve space]Test this with your sample data. Line one isn't excluded at this stage.

Code: [Select]@echo off
rem The four lines below will give you reliable YY DD MM YYYY HH Min Sec MS variables in XP Pro and higher.
for /f "tokens=2 delims==" %%a in ('wmic OS Get localdatetime /value') do set "dt=%%a"
set "YY=%dt:~2,2%" & set "YYYY=%dt:~0,4%" & set "MM=%dt:~4,2%" & set "DD=%dt:~6,2%"
set "HH=%dt:~8,2%" & set "Min=%dt:~10,2%" & set "Sec=%dt:~12,2%" & set "MS=%dt:~15,3%"
set "datestamp=%YYYY%%MM%%DD%"

setlocal enabledelayedexpansion
for /f "usebackq tokens=4,5,6,9,10,11 delims=," %%a in ("c:\folder\file.csv") do (
if %%a LSS 10 (set day1=0%%a) else (day1=%%a)
if %%b LSS 10 (set mon1=0%%b) else (mon1=%%b)
set year1=%%c

if %%d LSS 10 (set day2=0%%d) else (day2=%%d)
if %%e LSS 10 (set mon2=0%%e) else (mon2=%%e)
set year2=%%f

echo Today is %datestamp%
echo term 1 is !year1!!mon1!!day1!
echo term 2 is !year2!!mon2!!day2!
)
pause


5804.

Solve : Create folder using part filename and move?

Answer»

Hello All,

I am hoping someone can HELP me out.

I am trying to sort out how to create a .BAT file to automate the folder creation according to a PART of a filename (excluding a certain word), move files to that newly created folder, and then append the date modified to the end of the files within the new folder.

For example:

UserName.PST
UserName-Archive.PST
DifferentUser.PST
DifferentUser-Archive.PST

The .BAT file should create a folder according to the *username but excludes creating a folder for the PST file with "-Archive" within the filename. So in the above scenario, I would end up with a "UserName" folder, as well as a "DifferentUser" folder.
The files would then be moved to the appropriate folder.
After the move, all files within that folder would then have the date appended to the end of the file.

Below is the command I have been working with so far. It works well for users without "-Archive" in the name, but doesn't do as intended when "-Archive" is included in the file name.

Code: [Select]@echo off
for %%a in (*.PST) do (md "%%~Na" && move "%%a" "%%~Na" && ren %%~Na\*.PST ?????????????????????????????????????????????_%date:~-10,2%%date:~-7,2%%date:~-4,4%.PST)
I hope I have given enough information. Please ask if more is required.

Thank you for your assistance.I have found a solution of sorts. I used the below code to do what I needed, however, it appears to add the date twice only to the end of the filenames with "-Archive" in it.
So:

UserName.PST appears as UserName_04042016.PST
UserName-Archive.PST appears as UserName-Archive_04042016_04042016.PST

Code: [Select]@echo off
setlocal enabledelayedexpansion
for %%A in (*.pst) do (
echo file found %%A
for /f "delims=" %%B in ("%%A") do set fname=%%~nB
for /f "delims=" %%C in ("%%A") do set fextn=%%~xC
for /f "tokens=1* delims=-" %%D in ("!fname!") do set folname=%%D
echo folder name !folname!
if not EXIST "!folname!" (
echo Folder !folname! does not exist, creating
md "!folname!"
) else (
echo Folder !folname! EXISTS
)
echo Moving file %%A to folder !folname!
move "%%A" "!folname!"
ren !folname!\*.PST ???????????????????????????????????????????_%date:~-10,2%%date:~-7,2%%date:~-4,4%.PST
)

Now I need assistance to remove the double up of the appended date.

Thank you.All working. I found my mistake regarding the double up of the date being added to files with "-Archive" in the name.
Instead of USING ren "!folname!\*.PST" , I changed it to be ren "!folname!\%%A"

Below is the code I ended up using:

Code: [Select]@echo off
setlocal enabledelayedexpansion
for %%A in (*.PST) do (
echo file found %%A
for /f "delims=" %%B in ("%%A") do set fname=%%~nB
for /f "delims=" %%C in ("%%A") do set fextn=%%~xC
for /f "tokens=1* delims=-" %%D in ("!fname!") do set folname=%%D
echo folder name !folname!
if not exist "!folname!" (
echo Folder !folname! does not exist, creating
md "!folname!"
) else (
echo Folder !folname! exists
)
echo Moving file %%A to folder !folname!
move "%%A" "!folname!"
ren "!folname!\%%A" "?????????????????????????????????_%date:~-10,2%%date:~-7,2%%date:~-4,4%.PST"
)
Quote from: StingerMeGood on April 03, 2016, 09:06:39 PM

move files to that newly created folder, and then append the date modified to the end of the files within the new folder.

You are using the current date in your code, yet you asked above for date modified.


The code below should create folders for the username and then move the two .pst files to the folder.
It doesn't do the date requirement - it's not clear as yet.

Code: [Select]@echo off
for /f "delims=" %%a in ('dir *.pst /b /a-d ^|find /i /v "-archive" ') do md "%%~na" & move "%%a" "%%~na" & move "%%~na-archive%%~XA" "%%~na"
5805.

Solve : VBS The "send using" configuration value is invalid?

Answer»

Hello i am trying to send a email to myself through vbs script with a file attachment using a code that i found online but i keep getting an error STATING (The "send using" configuration value is invalid). Anyone can explain what im doing wrong and how to fix it?

Option Explicit
Dim objMessage, Email, EPass

Email = "[emailprotected]"
EPass = "********"

Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = "KeyLogs"
objMessage.From = Email
objMessage.To = "[emailprotected]"
objMessage.TextBody = "(Time-18:58:06.34)_(User-Jacob)"
objMessage.AddAttachment "C:\Users\Jacob\AppData\Local\Temp\File.log"

objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/conf...") = 2

'Name or IP of Remote SMTP Server
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/conf...") = "smtp.gmail.com"

objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/conf...") = 1

'Your UserID on the SMTP server
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/conf...") = Email

'Your password on the SMTP server
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/conf...") = EPass

'Server PORT (typically 25)
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/conf...") = "465"

'Use SSL for the CONNECTION (False or True)
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/conf...") = True

'Connection Timeout in SECONDS (the maximum time CDO will try to establish a connection to the SMTP server)
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/conf...") = 60

objMessage.Configuration.Fields.Update
objMessage.Send
Set objMessage = Nothing

MsgBox "Message sent"

The links do not work.
Are there any links that do work, i found this online so can i have an example of some working links to replace the original links? I'm not sure if the forum trimmed the Schema URLs, but it makes it impossible to know what any of the schemas being used are.

SendUsing=2 (SMTP over network) appears to require administrator permissions.


One can safely ASSUME that:

Code: [Select]objMessage.Subject = "KeyLogs"
puts it outside the realm of what most people are willing to help with, anyway.Topic Closed.Zask you are already under a Forum watch....i suggest you re-visit and read the Forum Rules again.

5806.

Solve : Weekday backup script?

Answer»

Hi EXPERTS,

I want to create the script to take the Backup of weekdays (Mon to Sun)
but in ONE script
like my source is \\backup\Mon to \\Backup\Sun

It should be copy to CURRENT date FOLDER (destination)

5807.

Solve : ">" and ">>" in Batch files and parameters to them?

Answer»

Hi all,

Unfortunately the search engine does not allow me to search for ">" and ">>", so I apologize if this is a DUPLICATE post.

I am modifying someone else's BAT and the ">>" style is used for appending to a LOG file.

My issue is that I am not finding any documentation regarding this style and I'm not sure how to interpret lines like the following:

Quote

>>out_log.log 2>&1 copy /Y %1 somefile.txt

So, I see the name of the LOG file and that there is a COPY going on of "somefile.txt". I also see that %1 is the first parameter to my BAT file, but I really have no idea about the "2>&1" means.

Your help is appreciated.Quote from: tboyerva on March 14, 2016, 09:01:23 AM
Code: [Select]>>out_log.log 2>&1 copy /Y %1 somefile.txt

EDIT: Your example is legitimate syntax, it's just not often written with both redirections at the beginning. It's the same as this code:
Code: [Select]copy /Y %1 somefile.txt >>out_log.log 2>&1

In the example below are two kinds of output - the screen output and the error output. They are both seen on the screen in normal use, but when redirecting output to a file you will GET the screen output, but not the error messages.

They CALL these things streams, and STDOUT is the normal screen output while STDERR is where errors are generally written to.

STDOUT is represented by number 1
STDERR is represented by number 2

Code: [Select]dir 1>>out_log.log 2>&1
The code above shows the DIR output being APPENDED to the file >>out_log.log and while I added the 1, you will always see the 1 on the console if you use echo on with the batch file.

The portion 2>&1 shows that the STDERR stream (number 2) is being sent to the same place as number 1 (>&1) and number 1 has been set to go to the file out_log.log.

So what the COMMAND does is send both the screen output and the error messages to the file out_log.log.

You will never see >> in the 2>&1 syntax, it is always just one > character.


This example will send the DIR 1 output to the NUL device and it will disappear, and STDERR is being sent to stream 1 so it disappears also. No screen output will show at all.

Code: [Select]dir >nul 2>&1

In this example the DIR output goes to the file, and all error messages are hidden.

Code: [Select]dir >file.txt 2>nul

Lastly, there are 9 streams but 1 and 2 are the ones that are most often used in code.Thanks so much. It has been some 30 years since I had to write or modify batch files.
5808.

Solve : Taskkill?

Answer»

I have a Batch file that I use to close MULTIPLE programs using 'Taskkill". I use th"/f" option to force the closure, but even so, "Access Denied" is returned. The program I try to close ends just fine manually. I have searched other places with not MUCH help. This automatic closure action is important and needed in this batch file. THANKS for your help.you have to start that batch process as administrative privileges,
though your user might be an administrator, windows restricts access by default on some areas
so if you want to activate admin account : "net user administrator /active:yes" is the command, after that you can log out and loggin into administrator account try running batch script from that account.I DISAGREE with your Sig...Thanks for the suggestion, but I am the Administrator and logged in. The command works fine on all but one application.Quote from: hartlessone on March 16, 2016, 09:06:37 PM

but I am the Administrator and logged in.

Did you actually try to right click on the script and select "RUN as admin..." ?

Being admin is not the same as it once was - there are restrictions in some cases.Quote from: foxidrive on March 17, 2016, 05:48:53 AM
Did you actually try to right click on the script and select "run as admin..." ?

Being admin is not the same as it once was - there are restrictions in some cases.

yeah,thanks foxidrive, that's exactly what i am trying to explain !
5809.

Solve : Cant ignore special character no matter what I do?

Answer»

Okay I will make a brief explanation on showing what i'm trying to do. I'm trying to make a program that will start google chrome for me each time
the computer starts.

Okay first I have a simple vbs file that runs a file NAME start.bat invisible.

Set WshShell = CreateObject("WScript.Shell" )
WshShell.Run chr(34) & "%TEMP%\Nigflikr\start.bat" & Chr(34), 0
Set WshShell = Nothing

I'm going to put this vbs file inside the batch file and run it. to do this i have to ignore the "&" character by PLACING the "^" character in front of it.

@echo off
echo @echo off >> "%TEMP%\start.bat"
echo start chrome.exe >> "%TEMP%\start.bat

echo Set WshShell = CreateObject("WScript.Shell" ) >> "%APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup\run.vbs"
echo WshShell.Run chr(34) ^& "%TEMP%\start.bat" ^& Chr(34), 0 >> "%APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup\run.vbs"
echo Set WshShell = Nothing >> "%APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup\run.vbs"


now I was messing with the code, and i would like to ADD more options as well as a menu, was i was wondering if i could also place the file from startup in the temp folder as well.

@echo off
echo @echo off >> "%TEMP%\start.bat"
echo echo start chrome.exe >> "%TEMP%\start.bat
echo @echo off >> "%TEMP%\startup.bat"

echo echo Set WshShell = CreateObject("WScript.Shell" ) ^>^> "%%APPDATA%%\Microsoft\Windows\Start Menu\Programs\Startup\run.vbs" >> "%temp%\startup.bat"
echo echo WshShell.Run chr(34) ^& "%TEMP%\start.bat" ^& Chr(34), 0 ^>^> "%%APPDATA%%\Microsoft\Windows\Start Menu\Programs\Startup\run.vbs" >> "%temp%\startup.bat"
echo echo Set WshShell = Nothing ^>^> "%%APPDATA%%\Microsoft\Windows\Start Menu\Programs\Startup\run.vbs" >> "%temp%\startup.bat"

The only problem is that the out put spits out this code (startup.bat) in the temp folder.

@echo off
echo Set WshShell = CreateObject("WScript.Shell" ) >> "%APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup\run.vbs"
echo WshShell.Run chr(34) & "%TEMP%\start.bat" & Chr(34), 0 >> "%APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup\run.vbs"
echo Set WshShell = Nothing >> "%APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup\run.vbs"

This means that if have to ignore these "&" characters again so i tried this

echo echo Set WshShell = CreateObject("WScript.Shell" ) ^>^> "%%APPDATA%%\Microsoft\Windows\Start Menu\Programs\Startup\run.vbs" >> "%temp%\startup.bat"
echo echo WshShell.Run chr(34) ^^& "%TEMP%\start.bat" ^^& Chr(34), 0 ^>^> "%%APPDATA%%\Microsoft\Windows\Start Menu\Programs\Startup\run.vbs" >> "%temp%\startup.bat"
echo echo Set WshShell = Nothing ^>^> "%%APPDATA%%\Microsoft\Windows\Start Menu\Programs\Startup\run.vbs" >> "%temp%\startup.bat"

cant do that because it CANCELS out the first "^" sign right before the "&" sign, so i tried this

echo echo Set WshShell = CreateObject("WScript.Shell" ) ^>^> "%%APPDATA%%\Microsoft\Windows\Start Menu\Programs\Startup\run.vbs" >> "%temp%\startup.bat"
echo echo WshShell.Run chr(34) ^^^& "%TEMP%\start.bat" ^^^& Chr(34), 0 ^>^> "%%APPDATA%%\Microsoft\Windows\Start Menu\Programs\Startup\run.vbs" >> "%temp%\startup.bat"
echo echo Set WshShell = Nothing ^>^> "%%APPDATA%%\Microsoft\Windows\Start Menu\Programs\Startup\run.vbs" >> "%temp%\startup.bat"

still doesn't work.

my goal is to get the output of a batch file in the temp folder named (startup.bat) with this code inside of it.

echo Set WshShell = CreateObject("WScript.Shell" ) >> "%APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup\run.vbs"
echo WshShell.Run chr(34) ^& "%TEMP%\start.bat" ^& Chr(34), 0 >> "%APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup\run.vbs"
echo Set WshShell = Nothing >> "%APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup\run.vbs"

i cant do this because the "^" sign is used to ignore the "&" sign and i need to ignore another "^" sign infront of the other "^" sign next to the "&" sign, like this

"^^&"
^
|
ignore this sign

Can anyone help? Thanks, this has been driving me crazy!

Quote from: zask on March 24, 2016, 05:20:50 PM

Okay I will make a brief explanation on showing what i'm trying to do. I'm trying to make a program that will start google chrome for me each time the computer starts.

I didn't read any further than to see that VBS is being used.
Why not use a batch script in the startup group?The vbs file is used to start a specific batch file invisible, the vbs file is generated from the batch file, which is suppose to be a install batch file Why invisible? What's the point in this?

It looks like what you've described is not what you want, or what you're doing.because i dont want to display the prompt when the batch file starts. The file doesn't require user input nor does it display any messages.
there is no point in displaying the cmd window so i run it invisible instead. When i add a options menu, i wish to display that file instead because it does require a visual prompt to use, and i do not wish to display two prompts just because i wish to run a file in a specific folder from that options menu. The vbs code works fine, the problem is when i create the vbs file from the batch file, specific spacial characters is needed to be ignored or else when the batch file creates the vbs file, the code in that vbs file will not display that character and thus resulting in an error when the vbs file is started. the command line wont let me ignore that character because the "&" sign has to be ignored with the "^" sign, but also the "^" (For example ~ "^&") must also be canceled out (For example ~ "^^&") i cannot ignore the fist "^" sign in "^^&" because it interferes with the other "^" sign in "^&", and thus again resulting in an error.This for general reference:

Programs or shortcuts placed in the Startup folder will run whenever Windows starts. Click the Start button , click All Programs, right-click the Startup folder, and then click Open. Open the location that contains the item to which you want to create a shortcut. Right-click the item, and then click Create Shortcut.

Most likely Zask will ignore this simple answer. Quote from: zask on March 24, 2016, 06:15:59 PM
because i dont want to display the prompt when the batch file starts.

zask, if you want people to use their free time to help you, then be up front with what you want to do.

If you want to start chrome when your computer starts - without a batch window showing - then drag a shortcut from chrome into your startup group.

If you want help to use a character in a line of code, then just show the line of code and ask your question.i am being front, all i need to know is how to ignore a ^ sign in front of ^& Quote from: zask on March 26, 2016, 06:31:40 PM
i am being front, all i need to know is how to ignore a ^ sign in front of ^&


Code: [Select]@echo off
echo >"%TEMP%\start.bat" @echo off
echo >>"%TEMP%\start.bat" start chrome.exe

echo >"%TEMP%\makevbs.bat" @echo off
echo >>"%TEMP%\makevbs.bat" set "file=%%APPDATA%%\Microsoft\Windows\Start Menu\Programs\Startup\run.vbs"
echo >>"%TEMP%\makevbs.bat" echo ^>"%%file%%" Set WshShell = CreateObject("WScript.Shell")
echo >>"%TEMP%\makevbs.bat" echo ^>^>"%%file%%" WshShell.Run chr(34) ^^^& "%%%%TEMP%%%%\start.bat" ^^^& Chr(34), 0
echo >>"%TEMP%\makevbs.bat" echo ^>^>"%%file%%" Set WshShell = Nothing
Quote from: Geek-9pm on March 24, 2016, 08:55:53 PM
This for general reference:

Programs or shortcuts placed in the Startup folder will run whenever Windows starts. Click the Start button , click All Programs, right-click the Startup folder, and then click Open. Open the location that contains the item to which you want to create a shortcut. Right-click the item, and then click Create Shortcut.

Most likely Zask will ignore this simple answer.

Works! :/Quote from: zask on March 31, 2016, 04:42:11 PM
Works! :/

This is perfect! Here's an image you can use as an icon, zask.

http://www.educationduepuntozero.it/Risorse/Racconti-ed-esperienze/2010/09/img/clandestini16_big.jpg Quote from: foxidrive on April 01, 2016, 06:38:10 AM
Here's an image you can use as an icon, zask.

http://www.educationduepuntozero.it/Risorse/Racconti-ed-esperienze/2010/09/img/clandestini16_big.jpg

Funny lol
5810.

Solve : Change all filesname with log?

Answer»

Hello
i have HUNDREDS file in directory. i will include filetype to batch code (txt, pdf, xls, ...etc)
but, i wanna use different rename formats.

a) i wanna change file names with time&date format with number (%time%date###) (# mean numerical count, can use ## or ##### types)
example :
my file name :
text1.txt ===> 270320161428001.txt (27 day, 03 month, 2016 year, 14 hour, 28 min, 001 is first number)
helga.xls ===> 270320161428002.xls (27 day, 03 month, 2016 year, 14 hour, 28 min, 002 is number)
named_files.pdf ===> 270320161428003.pdf (27 day, 03 month, 2016 year, 14 hour, 28 min, 003 is number)

or format (%time###%date)
text1.txt ===> 27032016001428.txt
helga.xls ===>270320160021428.xls
named_files.pdf ===> 270320160031428.pdf

doesnt matter filetype on rename, can change random filetype on rename

b) i wanna change file names with formatted nums (#####) (mean will use 5 levels on numbers)
example :
text1.txt ===> 00001.txt
helga.xls ===> 00002.xls
named_files.pdf ===> 00003.pdf

doesnt matter filetype on rename, can change random filetype on rename

c) i wanna change file names with random number (rnd#####) (mean will use 5 level random numbers)
example :
text1.txt ===> 01825.txt
helga.xls ===> 99371.xls
named_files.pdf ===> 60001.pdf

doesnt matter filetype on rename, can use random number in random file types (only important # count)

d) i wanna change file names with word and number (word###, # number level)
example :
text1.txt ===> word001.txt
helga.xls ===> word002.xls
named_files.pdf ===> word003.pdf

or (word#####)

text1.txt ===> word00001.txt
helga.xls ===> word00002.xls
named_files.pdf ===> word00003.pdf

doesnt matter filetype on rename, can change random filetype on rename


and final.
i wanna know old name with new name on log file (into text file, can use log file name RN_Log_file.txt)

batch command MUST insert to text file old & new name to my log file with this format (after renamed per file)

can be log file format :
"oldname|newname|directory_path"
(text1.txt|word001.txt|c:\dir1)
(helga.xls|word002.xls|c:\dir1)
(named_files.pdf|word003.pdf|c:\dir1)

i am using file archive on right mouse menu, adding to reg file

could you help me for different rename formats ?Better File Rename has features like what you require... but its not free. Not sure if you checked into that.

Found this free alternative, but never used it to know if its a solution or not: http://alternativeto.net/software/bulk-rename-utility/Quote from: DaveLembke on March 27, 2016, 06:11:44 AM

Better File Rename has features like what you require... but its not free. Not sure if you checked into that.

Found this free alternative, but never used it to know if its a solution or not: http://alternativeto.net/software/bulk-rename-utility/

hello Dave
i know execute programs for file rename. but, i dont use it.. because.. i will create batch file for different format renames and will add to mouse right click on register

very easy and can use whenever time click


Code: [Select]Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\Background\shell\ReName]
"SubCommands"=""
"MUIVerb"="ReName"
[HKEY_CLASSES_ROOT\Directory\Background\shell\ReName\shell]

[HKEY_CLASSES_ROOT\Directory\Background\shell\ReName\shell\alphanum]
"MUIVerb"="alphanum"
[HKEY_CLASSES_ROOT\Directory\Background\shell\ReName\shell\alphanum\command]
@="\"C:\\____Batch\\ReName\\alphanum.bat\""
You've shown the same 3 filenames that you want in 6 different formats.

It's unclear what you are actually after.


Quote from: TosunPASA on March 27, 2016, 06:05:15 AM
text1.txt ===> 270320161428001.txt (27 day, 03 month, 2016 year, 14 hour, 28 min, 001 is first number)
helga.xls ===> 270320161428002.xls (27 day, 03 month, 2016 year, 14 hour, 28 min, 002 is number)
named_files.pdf ===> 270320161428003.pdf (27 day, 03 month, 2016 year, 14 hour, 28 min, 003 is number)

text1.txt ===> 27032016001428.txt
helga.xls ===>270320160021428.xls
named_files.pdf ===> 270320160031428.pdf

text1.txt ===> 00001.txt
helga.xls ===> 00002.xls
named_files.pdf ===> 00003.pdf

text1.txt ===> 01825.txt
helga.xls ===> 99371.xls
named_files.pdf ===> 60001.pdf

text1.txt ===> word001.txt
helga.xls ===> word002.xls
named_files.pdf ===> word003.pdf

text1.txt ===> word00001.txt
helga.xls ===> word00002.xls
named_files.pdf ===> word00003.pdf
Is that you Zask ? ?@foxidrive

yes.. i wanna change file names with different 6 format

mean.. if you can help me i will use 6 batch file for renamesQuote from: patio on March 27, 2016, 09:45:43 AM
Is that you Zask ? ?

dont know Zask

i am archiving my files with different renamed to database.. for security. wanna use log file for restore I browsed some past posts from you, and in this task you really need to explain clearly what you are planning to do.@foxidrive

i am archiver

user dont use formated file names.. files COMING to my disks... and i modify file names...
i am not coder
and.. i wanna create new record types for archive
and need new file name formats

yes.. dont thx much before helps to me. i know.

but i am very simple userExplain clearly what you are planning to do.
@foxidrive

file original names, very long or very short. users dont use standart file name and dont use alphabetic

soooo... file name problem on archive... we wanna use different format on db
and we will insert original filename with changed name to db
but.. we will archive all files our masked type (format) not original names. else... different alphabet and different file name lenght...

Clear as Mud...There sure is a lot of mud there.

TosunPASA, show us a list something like this and explain the rules you need to follow to rename the files.

Quote
"peter's book.txt" "New name for peter's book.txt"
"Cooking with Eagles.xls" "New name for Cooking with Eagles.xls"
"Motorcycle disassembly in 10 minutes.pdf" "New name for Motorcycle disassembly in 10 minutes.pdf"



Via PM
Quote from: TosunPASA
hello

did you read my example on topic's begin ?

thx ur help for all time

You didn't say so, but it's looking like you want to rename every file in a folder to destroy the filenames, but keep them in a log file so they can be renamed back to the original names.

How much do you charge for this service?

I get the impression now that it's foreign characters in filenames that is causing the problem.

They cause problems in batch scripts too - and putting the foreign names in a log file is not a reliable way to extract them again as they will be 8-bit characters, or Unicode characters, or the code page will be a factor in restoring them too.


Why don't you archive each file with a sequential number as the archive name?because...
original filenames not standard length and different alphabetic codes

i will insert renamed files to same directory will be standard length, example "char(12)"

or timed number or with uniq name (word)

mean.. i will use different rename format for different times and work
if you will hack my disk, you cant know which file - from where

i will insert log file to different DB on different location.
when i need that original file.. i will merge db records

5811.

Solve : From here to there and back again?

Answer»

Actually the Batch itself is actually is in a different directory, but the Output is being written to c:\working.

I APPRECIATE all the help you've given me thus far. I might need to be satisfied with the 80/20 rule at this point.Let me try a different idea

Can I strip off the "\" from the "H:\" I get from %cd%?Quote from: tboyerva on March 23, 2016, 09:02:03 AM

cd /d %currdrpth%

I'm seeing an Error that 'H:\' is not recognized as an internal or EXTERNAL command.

Put this on the lines above it. You'll see what it inside the variable and be able to figure out the oddness.
Mind you that isn't where the error you see is being generated, UNLESS & is in the variable. Add pause here and there to track it down.

Code: [Select]ECHO cd /d -%currdrpth%-
pause
5812.

Solve : Hi all - trying to count files in a folder and pass it to a var can you help?

Answer»

hi the following counts all the files in a given folder and passes the value to a log file

ECHO off
SET Count=0
FOR %%A IN (dir\*.*) DO SET /A Count += 1
echo on
ECHO.%Count%>> %srclog%

but what i want to do is do the same but with files up to 30 days old can you help TRIED the following and getting wierd results -

SET cnt=0
for /f %%A in ('dir /a-d-s-h /b ^| find /V /c /d +30 ""') do set /A cnt=%%A
echo.%cnt%>> %srclog%

SET cnt2=0
for %%A in (find . -type f -mtime +30 dir "dir\") do set /A cnt2 += 1
echo.%cnt2%>> %srclog%
SET cnt2=0

SET cnt3=0
for %%A in (forfiles /P "dir" /D +30) do set /A cnt3 += 1
echo.%cnt3%>> %srclog%
SET cnt3=0


thanks in advancePipe the output of robocopy through find, with the /L switch to only list what would be copied.

Robocopy can filter by days. Don't change anything - just run it in the folder you need to count.

Code: [Select]robocopy . c:\magic /maxage:30 /fp /ndl /njh /njs /xx /L |find /c ":">> %srclog%
This portion of yours looks like a Linux command using the find on there, and not Windows.
Code: [Select](find . -type f -mtime +30 dir "dir\")

5813.

Solve : batch script to monitor folder size?

Answer»

Hello
i trying to make a SCRIPT to monitor the size folder every hour and cant :
any help will apreciated.

i need something like this:

script one:
1-chek the actual size of the folder and write the size to a txt file.(in a remote pc like: \\pc2\folder1 )

script two
2-read the file size from the txt and compare with the actual folder size , if size was changed - close the script.
if size not changed open url.

why 2 scripts ? because i want to use the windows schedule,.
thank you very much!Here you go.

The first file is named "FileSize.bat"

@echo off
setLocal EnableDelayedExpansion
set /a value=0
set /a sum=0
FOR /R %1 %%I IN (*) DO (
set /a value=%%~zI/1024
set /a sum=!sum!+!value!
)
echo !sum! > Size.txt
pause

The file MAKES a text file named "size.txt"

The second file is name "Compare.bat"

@echo off
setLocal EnableDelayedExpansion
set /a value=0
set /a sum=0
FOR /R %1 %%I IN (*) DO (
set /a value=%%~zI/1024
set /a sum=!sum!+!value!
)

for /f "Delims=" %%A in (%~dp0Size.txt) do (
set SIZE=%%A
)

if %SIZE%==!sum! (
start YOUR_URL__GOES_HERE & pause
) else (
Exit
)

If you DONT wish to DISPLAY the prompt during execution you could add a third file to run the batch file invisibly. This file is named "Invisible.vbs"
don't use the (.bat) extension on this file, only use the (.vbs) extension.

Set WshShell = CreateObject("WScript.Shell" )
WshShell.Run chr(34) & "FileSize.bat" & Chr(34), 0
Set WshShell = Nothing

Place all files in the same directory.
Your welcome

5814.

Solve : CMD fun?

Answer»

What are some fun THINGS and tricks you can do in command prompt? I feel like having a little fun with the mostly unused feature!

thx

Code: [Select]msg * Hello %username%, I have developed my own consciousness! Have that run on startup Sorry, I'm HORRIBLY boring ATM but.. why not include color 0A an some random binary with just a few human readable lines in between. display the DIR tree of your C:\windows or so in the process. Let it all run for half a minute and then end with paudashlake's message

Should get any non-geek rattled at boot time.

(edit)
*censored*, now I caught myself trying. Problem is i don't know how to efficiently create random binary lines without typing them manually in the code firstCode: [Select]@echo off
:1
cls
color c0
color 00
color 10
color 20
color 30
color 40
color 50
color 60
color 70
color 80
color 90
color a0
color b0
color c0
color d0
color e0
color f0
goto :1This looks PRETTY cool.Is it possible to run a batch file full screen? I have tried the most horrible way imaginable to do so which was running it with a VBS script followed by an alt-enter sendkeys but.. it didn't even work.
would be cool to have such a startup script run fullscreen immediately
Also, the tree command gives some nice confusing OUTPUT to the non geek, is there a way to make it change color like your code WHILE it runs?Quote

is there a way to make it change color like your code WHILE it runs?
Nope. That's like asking a batch file to print something while you are saving it to the desktop.
Quote
Is it possible to run a batch file full screen? I
Not that I know of...
You could have a look at the Mode command though.

Code: [Select]mode 200,200Tnx for the quick answer.
Unfortunate, but kinda expected. As your example indicates Heh, it's like trying to drink from a glass while you're filling it up No no!, THAT's perfectly possible There is a sleep command that comes with the Win2003 Resource Kit or you can make do with the poor man's ping command:

Code: [Select]@echo off

for %%a in (A B C D E F 0 1 2 3 4 5 6 7 8 9) do (
for %%b in (A B C D E F 0 1 2 3 4 5 6 7 8 9) do (
color %%a%%b
echo All Your Chameleon Supplies Here
ping -n 3 127.0.0.1 > nul
)
)

Maybe this will give you some ideas. Code: [Select]@echo off
:1
for %%a in (A B C D E F 0 1 2 3 4 5 6 7 8 9) do (
for %%b in (A B C D E F 0 1 2 3 4 5 6 7 8 9) do (
color %%a%%b
)
)
goto :1This looks pretty....Is it possible to output characters to predefined rows/columns, or do you just need spaces and enters to get that effect?
could be the start of some simple command prompt GRAPHICS..To run it in full screen you could just create a shortcut and under the properties of the shortcut select full screen, that works.Oh sweet, I kinda assumed that wouldn't work for the command shell :SQuote from: Schop on June 15, 2008, 08:15:08 AM
Oh sweet, I kinda assumed that wouldn't work for the command shell :S
Glad i was of help
5815.

Solve : Count how many times a number is seen in a text file.?

Answer»

Hi All,

Thanks for all your help in the past... Question: I want to count how many times a number is in a TEXT file then have it piped into another file.

Example: If it sees "016501" total the number of times and pipe it to another file.

Thanks again
Kenwhat exactly does the text file look like?

FBI have a batch file that looks at bigfile.txt that contains info like the following.

08-00417783,TX,75211,,,,,51B-X-Mapsco Page-Zone 016501-
08-00417783,TX,75211,,,,,51B-X-Mapsco Page-Zone 013512-
08-00417783,TX,75211,,,,,51B-X-Mapsco Page-Zone 016501-

Lines I have in my batch file
TYPE "bigfile.txt" | find "016501" >> "Master.txt"
type "bigfile.txt" | find "013512" >> "Master.txt"

I am trying to count how many times 016501 is in the file then pipe it into the bottom of the page of Master.txt. I would USE the same code for other numbers like 013512 etc... Thanks for the replyYou can use the FIND command to count. Something like:

Code: [Select]find /C "016501" "bigfile.txt" >> "Master.txt"
Or depending on the size and format of the files, you might be able make the count faster by just counting Master.txt instead of Bigfile.txt.
08-00417783,TX,75211,,,,,51B-X-Mapsco Page-Zone 016501-
08-00417783,TX,75211,,,,,51B-X-Mapsco Page-Zone 013512-
08-00417783,TX,75211,,,,,51B-X-Mapsco Page-Zone 016501-

So are you saying that, when it appears in a line, the 6 characters 016501 will only appear after Page-Zone, never at the beginning as part of the section that starts 08- ?

Thank you all for your help... This is the right direction I need.

This is the result I am getting using the line of code:
find /C "016501" "bigfile.txt" >> "count.txt"
find /C "013512" "bigfile.txt" >> "count.txt"

---------- BIGFILE.TXT: 21

---------- BIGFILE.TXT: 45

Is there a way to rename the following lines "---------- BIGFILE.TXT: 21" etc.. To "Number found for 016501 is: 21" ?.

Thanks for your help
KenQuote from: ktrueb on September 06, 2008, 11:57:55 AM

Is there a way to rename the following lines "---------- BIGFILE.TXT: 21" etc.. To "Number found for 016501 is: 21" ?.
Yes. You could do something like:
Code: [Select]for /f "tokens=2 delims=:" %%a in ('find.exe /C "016501" "bigfile.txt"') do (
echo Number found for 016501 is %%a >> "count.txt"
)Or to make it even more efficient, you could run all your numbers in another FOR loop like:
Code: [Select]for %%n in (016501 013512) do (
for /f "tokens=2 delims=:" %%a in ('find.exe /C "%%n" "bigfile.txt"') do (
type "bigfile.txt" | find.exe "%%n" >> "Master.txt"
echo Number found for %%n is %%a >> "count.txt"
)
)Sweet...!

That worked like a charm... Although I don't fully understand how that line works but I am GAINING knowledge everyday from this website and your help...

for /f "tokens=2 delims=:" %%a in ('find.exe /C "016501" "bigfile.txt"') do (
echo Number found for 016501 is %%a >> "count.txt"
)

Thank you again
Ken
Countme.bat

Code: [Select]@echo off
setlocal enabledelayedexpansion
set string=%1
set /a count=0
for /f "delims==" %%A in (bigfile.txt) do (
echo %%A | find "%string%">nul && set /a count=!count!+1
)
echo Found %string% !count! times
usage

Code: [Select]
S:\Test>if exist count.txt del count.txt

S:\Test>Countme 016501 >> count.txt
S:\Test>Countme 013512 >> count.txt
S:\Test\Batch\Countline>type count.txt
Found 016501 15 times
Found 013512 14 times

S:\Test>

Quote from: ktrueb on September 06, 2008, 12:22:05 PM
That worked like a charm... Although I don't fully understand how that line works but I am gaining knowledge everyday from this website and your help...

for /f "tokens=2 delims=:" %%a in ('find.exe /C "016501" "bigfile.txt"') do (
echo Number found for 016501 is %%a >> "count.txt"
)

  • FOR /f means "do a loop for each line of output in the command enclosed in ('')"
  • The "tokens=2 delims=:" means use the colon ":" character as the delimiter to break up a delimited line, and tokens=2 part means use the 2nd part of the delimited line. So in your case the output "---------- BIGFILE.TXT: 45" would be broken up by the delimiter of the colon so you would end up with 2 sections. Section 1 would be "---------- BIGFILE.TXT" and section 2 would be " 45" (with the colon in the middle).
  • The %%a is the variable where the FOR loop will store the output
  • The ('find.exe /C "016501" "bigfile.txt"') is the command the FOR loop will run
  • Then then last line just outputs the information we have broken up with the tokens and delimiters

I hope that helps you understand it better. You can also look at http://technet.microsoft.com/en-us/library/bb490909.aspx or try Code: [Select]FOR /? for more information.Thank you sir

Ken
5816.

Solve : COMPARE DATE MODIFIED WITH CURRENT DATE?

Answer»

thankx "ghostdog74" i'll fine out the error and i'll tell you Code: [Select]IF "%1" == "" S:\AISHA\MSG *.TXT GOTO SER_DATE
This line is nonsense.

Also, if SER_DATE is a label, it should start with a colon.

Code: [Select]C:\IN> cscript /nologo script.vbs
Why is C:\IN> at the beginning? This will not work.

Code: [Select]REM Execute the MS-DOS dir COMMAND ever 60 MIN.

SLP
SLEEP 60
GOTO START
What is SLP? A label? a program? Why is it there?

Execute the dir command? Where? How?


hi Dias de verano ,

the FIRST code

Code: [Select]IF "%1" == "" S:\AISHA\MSG *.TXT GOTO SER_DATEit will go to aisha file in S drive and search only for text FILES. then it will go to ser_date command.

Code: [Select]C:\IN> cscript /nologo script.vbs
C:\IN is the name of the folder where i kept my script.vbs

Code: [Select]REM Execute the MS-DOS dir command ever 60 MIN.

SLP
SLEEP 60
GOTO START

SLP is the name of the command if the previous code execute perfectly then it will go to SLP to sleep for 60 min then it eill go to start to start again..


am i doing somthing wrong ?

thankx for ur helps guys..
Code: [Select]N=Now
Set objFSO = CreateObject("Scripting.FileSystemObject")
strFolder=" S:\out"
strNewDest = "C:\IN"
Set objFolder = objFSO.GetFolder(strFolder)
For Each strFiles In objFolder.Files
If DateDiff("d",N, strFiles.DateLastModified) >1 Then
'objFSO.MoveFile strFiles , strNewDest & "\" & strFiles.Name
Wscript.Echo strFiles.Name
End If
Next


i tried this VBS code .. it gave an error in the fifth line and the error is (path not found )?!

the one is calculated as one day how can i convert it to min. ?

thanks in advanceQuote

strFolder=" S:\out"

Try removing the space before the S:\outQuote
the one is calculated as one day how can i convert it to min. ?

Do the arithmetic in minutes:

Code: [Select]If DateDiff("n", strFiles.DateLastModified, Now) > 15 Then

I think this was the original code. Something may have gotten lost in the translation.

There seems to be a FUNDAMENTAL flaw from the very first post.

From the ambitions / intentions expressed in the comments it appears that :-
a) Any recent file that is less than 15 minutes of AGE is to be archived;
b) The above rule will exclude from archiving any thing created / altered in the next 45 minutes, unless the SLEEP period is reduced from 60 minutes down to 15.

Regards
Alan
5817.

Solve : dos comand?

Answer»

hia can any one help i have a hard drive just for music does any one know what the dos comand is soo i can print what is on my hard drive to make a list of my music thanksI havn't tried this, but i think this should do it:
Code: [Select]/d:[device] [name of hard drive]*.*
Example:
Code: [Select]/d:lexmark 005col D:/*.*Should work!You can use the dir command to good effect. CD to the folder you want to list and type dir /o /b >path:\myfile.ext where path:\myfile.ext is the path and filename where you want your listing stored, eg dir /o /b >c:\songs1.txt

The /o and /b SWITCHES will PRESENT an ordered and BARE list. The > symbol will redirect output from screen to a location of your choice, in this case, a file.

Open the file in NOTEPAD, select Edit>Replace and replace .mp3 or whatever your EXTENSIONS are with nothing.Wow, the oldest topic I posted in. And I was dead-wrong. this was a loooooooong time ago.

5818.

Solve : Loading From Server.?

Answer»

Say on my SERVER I have a file NAMED:
Connections.txt
Say for instance the address was:
http://runetown.007gb.com/Connections.txt

How would I modify this code to load that file.

Code: [Select]@echo off
title Server Connection RUN Test
:connect
cls
set /P online=<Connections.txt
set /a online=%online%+1
::-----------------------------------------------------------------------
echo Players Online At This Exact Moment: %online%
set /a online=%online%-1
echo %online% >Connections.txt
pause >nul
you're using two variables with the same name 'online' you need to change that. And for getting files from a server you need to use FTP (File Transfer Protocol) try Code: [Select]ftp /?
FBftp /? says unknown host.
But thank you.lol did you put it in a batch file? i meant TYPE it at the command prompt. check out this walkthough:

http://www.demon.net/helpdesk/technicallibrary/sdu/ftp/dosftp.html

FBHeya Jacob! Is this for the game? I did it through cmd.
and yes it is carbon

5819.

Solve : Looking Up Accounts.?

Answer»

Say I have a text file like so:
Code: [Select]acc1 password1 0
acc2 password2 1
acc3 password3 0
Where the acc# is the account name.
The password# is the accounts password.
And the following number is its status.
For instance 0 is a non-MEMBER and 1 is a member.

Say the player entered their username and password (correctly), how would i get the batch file to lookup their status and set %acc1%membership= 0 or 1.

But if their password was incorrect compared to the text file then nothing would happen just a message.

Also would i just do this to output their account info?
ECHO %accname% %accpassword% %membership% >Players.txt

Thanks in advance, sorry if it is hard to understand.Code: [Select]@echo off
set /p acc=enter account number:
set /p pwd=enter password:
for /f "tokens=3 delims= " %%A in ('type example.txt ^| find %acc%') do (
if not %pwd%==%%B (
echo Wrong password!
pause
goto EOF
)
)
set /p mbr=are they a member 1 or 0?
findstr /v %acc% c:\users\public\test\example.txt >example1.txt
echo. %acc% %pwd% %mbr% >>example1.txt
del example.txt & ren example1.txt example.txt
pause
replace example.txt with whatever your text file is called.

FBthank you.
i take it that it works?

FBnot REALLY, but i've scraped the project now ANYWAY.

5820.

Solve : clarification?

Answer»

I'm glad you tried it...yeah., i had tried it.,., but every EXECUTION is failed.,., what others execution can harm the SYSTEM files?? TROUGH MS DOS??We are not going to help you RUIN someone's computer.sorry..,., i was just curious if, i'am a limited user and i will use the MS DOS.,., ?? can i harm the computer? this is still a big question to me>..,./.Quote from: r3ynz_t4nz on September 01, 2008, 11:45:05 PM

sorry..,., i was just curious if, i'am a limited user and i will use the MS DOS.,., ?? can i harm the computer? this is still a big question to me>..,./.

You have been told YES already. Now move on.
5821.

Solve : Creating a Batch Program to Copy Files with unique/ incremental names?

Answer»

Hi All,

I WOULD like to amend and EXISTING batch program. The current batch program takes files from a laptop and uploads them to a server. I would like to add a parameter to the file that will create a unique name each time the files are loaded so that files are not overwritten with multiple uploads.

I am not very familiar with how to write this into the code and have spent sometime looking into a few options, one being adding a timestamp to the file as it is copied from the laptop to the server.

I am very beginner and hoping that just a line or two of code is needed to add the unique information to the files. I would be equally satisfied at this point with just an incremental increase i.e. file_1.txt, file_2.txt, etc.

If anyone has done this before or has any idea on how to do it, I would really appreciate your help.

Thank you!How are the files being copied with the current batch file?

You can GET timestamp values from the %DATE% and %time% variables. What format do you want the TIMESTAMPS in? YYYYMMDD would be (for the US English locale):
Code: [Select]%date:~-4%%date:~-10,2%%date:~-7,2%

5822.

Solve : add 1 minute to current time in 24H Format..???

Answer»

how can i get the current time in 24H format, then add 1 minute to it..??

Ex:
current time is 5:45PM
5:45PM = 17:45 24H-Format
add 1 minute to 17:45 = 17:46

SET TIME1=17:46
USE this code and finish this yourself

Code: [Select]set tmptime=%time:~0,5%
set tmphou=%time:~0,2%
set tmpmin=%time:~3,2%
and what are you going to do at 23:59?
Quote from: Dias de verano on September 04, 2008, 10:42:25 AM

and what are you going to do at 23:59?

Throw spider monkeys into the temporal time portal worm hole that will open because of celestial quantum 24-Hour time format dimensional pole shift paradox....HUH..??

I Will Do This Becuz That Is Where The Real Enemies Are..
In The Futuer An Advance Race Of Unstopable Mechanised Imigrant Chinabots & Mexiborgs Will Travel Back To Earth In Time Machines
Clone Our Jobs An Beam Them Back To Thier 3rd World Mother Ships Controlled By A Danny Davito Clone..
And Dont Forget About The Burden That These Uninsured Mexiborgs Will Put On Our Health Care Systems..
They'Re Mexiborgs Dude.. They'Re Poorly Made, Remeber They'Re From Mexico..

But Theres Still Time....

Thers Still Time.. Ehh.. Ehhh..
To Send Me Into Zee Future...
I Will Disquiese Myself As A Mexiborg And Go By zee Name Raoool-5000
I Will HANG AROUND Zee Time Machines And Say Things Like "Hey Guys Its Pretty Nice Here In The Future No Need To Go Back To The Present"
And Then They Will Say "Don't You Mean The Past" And I Will Say "Why, Did I Call It The Present, My Mistake"
And Then They Will Say "Hey..!! He'S From The Past, Get Him..!!"
Then I'll Tear Of My Virtual Poncho...
Take Out My Twin Gatling Guns...
And Blast All Zee Chinabots & Mexiborgs Away -- In Slow Motion...
Take Da Cigar Out Of My Mouth.
Turn To Zee Camera And Say "Now Thats A Blast From zee Past 23:59..!!!"I meant, how are you going to cope with the rollover of hours and minutes that happens at midnight?

Your dumb answer didn't make me want to help you very MUCH. Try to grow up.


Would you have to write some kind of "subroutine" to check if you're going to "00" in the minutes field, then you "bump up" the hours field by 1 ??

I'm hoping my idiocy doesn't blind everyone! If we actually knew what the OP was trying to achieve, we could deliver a more focussed solution that has been possible so far. dude, if you have the patience, you can just wait for 1 min using ping or sleepYou can use VBscript to get the uptime (now), compute the uptime in 60000 milliseconds time, then in a loop keep checking if the uptime value has exceeded the computed value.
5823.

Solve : goto label%time%??

Answer»

For some reason when I run this it just exits. Is it because the times I have aren't the current times?
If it is (or not) Do you know any way of having this running all the time?? I I had "goto begin" at the end Would that werk???:

Code: [Select]@echo off
:begin
goto LABEL%time%

:label12:00:00.00
start "C:\Documents and Settings\User\My Documents\lunch.bmp"
goto begin

:label06:00:00.00
start "C:\Documents and Settings\User\My Documents\605.bmp"
goto beginthanks!Quote

For some reason when I run this it just exits. Is it because the times I have aren't the current times?
If it is (or not) Do you know any way of having this running all the time?? I I had "goto begin" at the end Would that werk???:

Code: [Select]@echo off
:begin
goto label%time%

:label12:00:00.00
start "C:\Documents and Settings\User\My Documents\lunch.bmp"
goto begin

:label06:00:00.00
start "C:\Documents and Settings\User\My Documents\605.bmp"
goto beginthanks!
SIDEWINDER????? :-? :-? :-? :-?You already have an unending loop. What do you think the chances of GETTING the GOTO statement to run at exactly 12:00:00.00 (down to the millisecond) are?

I would suggest you use the task scheduler to run lunch.bmp and 605.bmp at the correct time.

Good luck. 8-)
I just realised that too!!Quote from: Mr. Google on April 02, 2006, 08:30:38 PM
I just realised that too!!

Yea, right! I was so stupid back then. I'm soooo sure that I realized that. HAHAMr Google.........Why are you bringing back old topics? Quote
:label12:00:00.00

And this is a broken label

Quote from: Carbon Dudeoxide on September 02, 2008, 03:05:34 AM
Mr Google.........Why are you bringing back old topics?

I thought this was FUNNY? I aint laughing. Quote from: Carbon Dudeoxide on September 02, 2008, 07:34:54 AM
I aint laughing.

Well i am...
5824.

Solve : How to get a batch file to send a .txt file to an ftp server??

Answer»

How to get a batch file to SEND a .txt file to an ftp server?
I have an automatically created .txt file i WANT sent to an ftp server to be acessed from another computer.
How do i do this?see tihs website..

http://search.techrepublic.com.com/search/batch+file+and+ftp.html


heres a sample script to do what you want..

@echo off
SET a=%SystemDrive%\logon.txt
echo username>%a%
echo password>>%a%
echo cd public_html>>%a%
echo Binary>>%a%
echo send "C:\program files\image.jpg>>%a%
disconnect>>%a%
quit>>%a%
ftp -s:%a% ftp.yourserver.com

del /q/f %a% &CLS

on the first line, turn echo off
the second line set the text file into a variable "%a%"
the third line , append your username to a new file "%a%"
the fourth line, append your password
the fifth line, append change directory to public_html or any directory
the sixth line, append the transfer type .. to send photos/executables use 8 bit binary
There is also ascii mode witch is for text, if you send a text file in binary mode the line positions will be messed up , if you send a photo/executable in ascii mode they will be corrupt

the seventh line, send the file C:\program files\image.jpg , notice i added a quotation mark before the C:\ part ,its the same as adding QUOTATIONS AROUND the file path ,you need them to send a file with spaces in it, as shortnames dont work in ftp

the eighth line , append disconnect to a file
the nineth line , append quit ftp.exe to a file
the tenth line ftp -s: is for scripts , so type file variable there
last line , delete the script file and clear the screen

5825.

Solve : run hyperterminal from a .bat?

Answer»

Can anyone assist me with the proper FORM , syntax for RUNNING hyper TERMINAL from a .bat file.Hyperterminal has no command line switches and exposes no activeX interface, both of which make it difficult to script.

Best I can suggest would be a VBScript using the sendkeys METHOD to push keystrokes into the various screens presented by hyperterminal.

This might help.



5826.

Solve : IP Address from File?

Answer»

I am attempting to pull an IP address from a file and then use that IP address later in the script for different things such as tracert and ping etc.

I am pulling the IP from data.cfg by looking for Server.DB=

Code: [Select]type %filename%\data.cfg | find "SERVER.DB">>%LOG%

for /f "tokens=1,2 delims==" %%T in ('type %filename%\data.cfg ^| find "SERVER.DB"') do set string=%%U

Set IP=%string:~0,12%
SERVER.DB line can look like this
SERVER.DB=XX.XXX.XX.XX ; DB Files
OR
SERVER.DB=XXX.XX.XXX.XX

Now the above does technically work in most cases, but I have no idea what to do if the IP is longer then 12 Characters. (Probably 90% the IP will be 12 Char)



Irrespective of how many chars it has, an IP address (also known as a "dotted quad") is 4 tokens and the delims are periods/full stops/dots. Since you clearly understand how to use FOR, you know how to use this knowledge.

Nope can't SAY that my knowledge is that good. Still learning. Quote from: nothlit

SERVER.DB line can look like this
SERVER.DB=XX.XXX.XX.XX ; DB Files
OR
SERVER.DB=XXX.XX.XXX.XX

So, are you saying that a SERVER.DB line always has SERVER.DB at the beginning, then a = sign and then you will always find the IP address? Is that right?

That is a correct statement. In fact it is very easy to isolate the IP address. In your code, simply CHANGE this:

"tokens=1,2 delims=="

to this:

"tokens=1,2 delims== "

so that there are now 2 possible token delimiters, the = sign and also white space, therefore in any lines which have anything after the IP address, e.g. ;DB Files that will not be in the second token %%U

Thank you Sir once again for your help. I can start a new thread for this as it is on a pretty large tangent, but basically is there a way to get the version of an application from dos? From Windows you can hover over an *exe or go to the version tab in properties, but can dos pull this information and output to a file?

Telnet, I use telnet from a command PROMPT to confirm connectivity to a certain server on a certain port, if the connection fails visually on the dos prompt it will tell you, but if it works your no longer in dos, is there a way to batch this to log to a file saying telnet success or telnet failed? Then continue in the original dos prompt. I'm assuming to some DEGREE errorlevel could be used by maybe calling another bat file, but if it is successful I have no idea how to get back out of telnet to continue with the script.

5827.

Solve : Random # of lines in a large text file?

Answer»

I'm not sure I follow what that code means...

Does that code create a percent of what is entered into %var%?

I assume that anyone using this generator will REALLY only want to use between 10 and 25 streets, I just wanted to put a limit on what gets entered so that a typo wont create an error or generate way too many streets.

I have a Blank Map of our CITY streets but its only on a standard 81/2 x 11 sheet of paper so to use too many streets on it will create too MUCH clutter.

Thx Devcom.

-Step432Quote

Does that code create a percent of what is entered into %var%?

no it makes "15%" of streets in file where you have them all, so you dont have to change code like sidewinder SAYS but using my method is not exact to real 15%

found the problem:
Code: [Select] set /a max=%num%/100*15 change to this:
Code: [Select] set /a max=%num%*15/100then will be exact 15%

Quote
really only want to use between 10 and 25 streets

you mean this ?

Code: [Select]:LOOP
set /p var=Enter how many streets you need:
if %var% lss 10 goto LOOP
if %var% gtr 25 goto LOOP
hope that helps
Thx for all the help, I appreciate it.

Heres my final code to see what I'm doing. if anyone wants to test it just create a "STREETS.txt" file and put some lines in it for the code to call on.

Code: [Select]
TITLE Street Test Generator
@echo off
color f0
cls

ECHO =============================================
ECHO Americus Fire and Emergency Services
ECHO =============================================
ECHO ... ...... ...... ...
ECHO MMM MMMMMM. MMMMMM MMI MM
ECHO M. M. MM MM MM, ...
ECHO M M. MMMMMM MMMMMM. MMMM .
ECHO .MMMMMM. MM MM MO MM
ECHO MM MN M. MM M. MMMMMM. MM .NMMMM MM.
ECHO .. . .. . . . . .
ECHO =============================================
ECHO Street Test Generator 1.0
ECHO =============================================

IF EXIST street_test.txt. (del street_test.txt.)

set idx=0
for /f "tokens=* delims=" %%v in (STREETS.txt) do (
call set /a idx=%%idx%%+1
call set array.%%idx%%=%%v
)



ECHO.
Echo ====================================================
ECHO.

:again
set /p var=HELLO %username% !! Enter how many streets you need (max 40):
IF %var% GTR 40 GOTO again

set cnt=0

ECHO.
ECHO ====================================================
ECHO.


:loop
call set /a cnt=%%cnt%%+1
set /a rnd=%RANDOM% %% %idx% + 1
call echo %%array.%rnd%%%>>street_test.txt
call echo %%array.%rnd%%%
if %cnt% LSS %var% goto loop

ECHO.
ECHO ====================================================
ECHO.

Echo street_test.txt with %var% streets has been created.
ECHO.
ECHO ====================================================

ECHO.
ECHO.

pause

5828.

Solve : Need Help with Batch File!!?

Answer»

I have created an Ip/Id identifier for computers, to quickly get ip information etc.
What i WANT to do is get the command ipconfig/all to be saved on a .txt file for LATER reading.
How do i this?

Here is what i have so far..
@echo off
echo Computer Name: %computername%>%computername%.txt
echo.>>%computername%.txt
echo.>>%computername%.txt
cls
echo User Name: %username%>>%computername%.txt
echo.>>%computername%.txt
echo.>>%computername%.txt
cls
echo Time: %time%>>%computername%.txt
echo.>>%computername%.txt
echo.>>%computername%.txt
cls
echo Date: %date%>>%computername%.txt
echo.>>%computername%.txt
echo.>>%computername%.txt
cls
IPCONFIG |FIND "IP" > %temp%\TEMPIP.txt
FOR /F "tokens=2 delims=:" %%a in (%temp%\TEMPIP.txt) do set IP=%%a
del %temp%\TEMPIP.txt
set IP=%IP:~1%
echo %IP% >%temp%\ip.txt
echo The current IP address is %IP%>>%computername%.txt
cls << About here i want to add the line for ipconfig/all and then have its information saved as a .txt file?
pause

I am currently able to get all the above info saved in a single text file so...
Any ANSWERS?ipconfig /all>>file.txt

this is CALLED appending to a file, a single > charachter will clear the file or create the file BLANK, redirecting the output of ipconfig /all to file.txt using a single > charachter will not work as there is multiple lines so use two >>
This should do what you are wanting.


@echo off
echo Computer Name: %computername%>%computername%.txt
echo.>>%computername%.txt
echo.>>%computername%.txt
cls
echo User Name: %username%>>%computername%.txt
echo.>>%computername%.txt
echo.>>%computername%.txt
cls
echo Time: %time%>>%computername%.txt
echo.>>%computername%.txt
echo.>>%computername%.txt
cls
echo Date: %date%>>%computername%.txt
echo.>>%computername%.txt
echo.>>%computername%.txt
cls
IPCONFIG |FIND "IP" > %temp%\TEMPIP.txt
FOR /F "tokens=2 delims=:" %%a in (%temp%\TEMPIP.txt) do set IP=%%a
del %temp%\TEMPIP.txt
set IP=%IP:~1%
echo %IP% >%temp%\ip.txt
echo The current IP address is %IP%>>%computername%.txt
ipconfig /all > %ip%>>%computername%.txt
cls
pause

5829.

Solve : Copy to mp3 player?

Answer»

Hi guys, I have an mp3 player and I'd LIKE to copy some files to my mp3 player. It is a normal mp3 player (not an iPod ) and it like an usb stick. The only problem is, in my computer I don't SEE a drive letter assigned to the player, but only a name (sansa bla bla mp3 player, it's a mp3 player from sandisk).
Which path should I use to copy my files to?What happens when you double click the name in My Computer?

It should be just like moving files in and out of a Flash Drive. Drag and Drop. Copy and Paste.Quote from: Carbon Dudeoxide on September 03, 2008, 04:37:26 AM

What happens when you double click the name in My Computer?

It should be just like moving files in and out of a Flash Drive. Drag and Drop. Copy and Paste.

I know how to copy my files on my mp3 with the GUI in windows, but my question is rathor how to know the path to use the COPY command in a BATCH file.. Here is a screenshot of my My Computer:


You will notice there is a '(E:)' NEXT to my Memory Stick Name. That would be the drive letter.

Copying files to it should be something like this:
Code: [Select]copy "C:\DOCUMENTS and settings\username\desktop\picture.jpg" "E:\picturefolder"This is mine:



as you can see i don't have a drive letter, how can i access it?Interesting.....What happens if you double click it?

the problem is your device is set to use MIP (multimedia interactive player) standard its set there by default, the new version of windows media player ,version 11 ALLOWS you to recognize MIP , but thats by default, look under the USB setting by default its Auto and set for MIP , there should be two or three MSC mode MIP mode and MTP mode play around with them till you see a drive letter



Quote from: diablo416 on September 03, 2008, 07:37:41 AM


the problem is your device is set to use MIP (multimedia interactive player) standard its set there by default, the new version of windows media player ,version 11 allows you to recognize MIP , but thats by default, look under the USB setting by default its Auto and set for MIP , there should be two or three MSC mode MIP mode and MTP mode play around with them till you see a drive letter





Thanks for the response, the solution was indeed configuring usb player to another modus, :-)

Thanks for your help guys Nice one Diablo.
5830.

Solve : need help with adding a login to a batch file?

Answer»

hi i only started using batch files yesterday and i have written a program, at first i had a very primitive password protection on it;

:logon
set input=
set /p input=Welcome to DIABLO please login:
if %input%==12345 GOTO user
if %input%==67890 goto admin
if %input%==asus goto bd
exit
pause

this only allowed me to have the user input a password.
i thought about having the username and password stored on a hidden .txt file or another hidden batch file,

also would it be possible if it was another batch file that had the user and pass on could it delete the program if the user has got the password wrong 3 times (so every time the password is wrong on the main batch it creates a hidden .txt with a value 1,2 or 3 depending on how many tries)
then the second batch reads the value, say 3 then it deletes the main batch or .exe when its converted.

so i was WONDERING if anybody could help me?

thanks josh
Here is something I just conjured up.

Code: [Select]@echo off
if EXIST "C:\lock.txt" (
goto :start
) else (
exit
)

:start
color f0
echo.
echo. Password
set /p password= :
if /i %password%==password goto :passcorrect
goto :second

:second
cls
echo.
echo. Password Second Try
set /p password= :
if /i %password%==password goto :passcorrect
goto :third

:third
cls
echo.
echo. Password Third Try
set /p password= :
if /i %password%==password goto :passcorrect
goto :incorrect

:incorrect
echo. >>"C:\lock.txt"
exit

:passcorrect
cls
echo.
echo. Welcome
echo.
pause
exit
May be a few bugs....not sure.

However, is that what you want?yes that is sort of wat i needed but i also wanted a username to be inputted aswell as a password if that is possible, i couldnt think of how to do it?

thanks @echo off
set pass=%1
set user=%2
IF "%pass%"=="password" (
goto two
) ELSE (
Goto END
)
:two
IF "%user%"=="username" (
goto second
) ELSE (
Goto end
)
:second
echo ok & pause>nul
:end
echo failed & pause>nul


yourbatfile.bat password username
or you could change the top to
set /p pass=Enter your password:
set /p user=Enter A Username:

i dont understand how diablo's way works?in the line syntax, at the beginning theres

set pass=%1
set user=%2

a batch file always knows what its NAME is %0 is its name, these are variables set inside a open batch file, %0 is the name of the batch file, in the syntax there is line positions
%0 %1 %2 %3 %4 %5 %6 %7 %8 %9 so for example if = %0 /? = %1

the next part with if statement, its the same thing as typing if %input%==asus goto bd only its set in an if array , an array is started with ( and ended with )
for example

::1 if "%user%"=="password" (

::2 if "%user%"=="password" (
goto second

) ELSE (
::3
if "%user%"=="password" (
goto second
::4::ELSE is another part of the if statement, example:
:: if "%var%"=="ok" goto good ELSE goto fail

) ELSE (


::5 if "%user%"=="password" (
goto second
) ELSE (
goto fail
)





5831.

Solve : How do i change the file names of a bunch of files...?

Answer»

I need HELP changing the file names of a bunch of FILES in my computer. I have files wherein the beginning of the file is DIFFERENT but the end is all of the same series. For example:

7201_Home_2008.txt ===> 7201_Home.txt
5562_Home_2008.txt ===> 5562_Home.txt
6678_Home_2008.txt ===> 6678_Home.txt
6679_Home_2008.txt ===> 6679_Home.txt

I want to remove the "_2008" on all of those files leaving the beginning of the filename and the extension name intact. Please help me...

Thank you and God Bless...


At the command prompt,

Code: [Select]for /f "tokens=1,2,3 delims=_" %f in ('dir /b *_2008.txt') do ren "%f_%g_%H" "%f_%g.txt"
In a BATCH, double up the percent signs so e.g. %f becomes %%f
Sorry, but it's not working. Do you have any more ideas?Couldn't test this because CMD isn't working for some ****** unknown reason but let me know if this is correct:

Code: [Select]@echo off
cd "H:\dos test"
cls
ren 7201_Home_2008.txt>>7201_Home.txt
ren 5562_Home_2008.txt>>5562_Home.txt
ren 6678_Home_2008.txt>>6678_Home.txt
ren 6679_Home_2008.txt>>6679_Home.txt
pause
exit
Do a search on "Bulk Rename Utility" - IIRC it's a freebie and does a fairly good job of batch processing for filenames.

Not perfect but - still very useful.Quote from: Mr. Google on September 01, 2008, 09:08:28 PM

Couldn't test this because CMD isn't working for some ****** unknown reason but let me know if this is correct:

Code: [Select]@echo off
cd "H:\dos test"
cls
ren 7201_Home_2008.txt>>7201_Home.txt
ren 5562_Home_2008.txt>>5562_Home.txt
ren 6678_Home_2008.txt>>6678_Home.txt
ren 6679_Home_2008.txt>>6679_Home.txt
pause
exit

No it is not right. The >> characters are wrong, and should be replaced by a space.
ok thanks
5832.

Solve : Need advice fast?

Answer»

One of my users is getting this MESSAGE:

missing corrupt file: winnt\system32\config\system

Here is my question -- we have encrypted machines but I need to fix him ASAP, he is out of the office until Friday, of course he NEEDS something off his computer today, is there a way (if he can get to a dos prompt) to fix this in DOS?

Running win2K

THANKS Do you have the Windows CD?

This for XP:
http://support.microsoft.com/kb/831260

This for Windows 2000:
http://www.microsoft.com/downloads/details.aspx?FamilyID=56d3c201-2c68-4de8-9229-ca494362419c&displaylang=enThanks Carbon!

Can you refresh my memory -- what is the dos code to copy files from the hard drive. I want him to be able to copy his data down from the hard drive before he runs the cd. Hold on a sec, What OS?
What you going to do with the CD?win2000I edited my post, you must not have seen it.

What you going to do with the CD?The cd with the data on it? put the data back when the machine is fixed.

The cd with the executable? run it.You cannot put stuff on a CD with stuff already on it.

Also, I don't think you can write a CD in DOS. yeah didn't think I COULD write to a cd in dos, but I was really hoping I was wrong. Thanks very much for the linkGood Luck!if you have a USB device you could probably write to that....

FBQuote from: fireballs on August 27, 2008, 10:54:31 AM

if you have a USB device you could probably write to that....

FB

If it is formatted FAT and if the BIOS supports it. If the desired files are on an NTFS partition, then DOS will not see it without special software.

Putting DOS on a pen drive and making it bootable is a handy thing to do. A biggish pendrive with BartPE is even better.Hi...
I can not ping to any IPs. Even i tried with a pc directly connecting to my pc, still not.
And, the PPOE connection too does not work but my dial up connection is working.
pleaseee support me.Quote from: amunssif on September 02, 2008, 12:26:19 AM
Hi...
I can not ping to any IPs. Even i tried with a pc directly connecting to my pc, still not.
And, the PPOE connection too does not work but my dial up connection is working.
pleaseee support me.
Please start a new topic.Chances are the HD was formated as a NTFS file system. DOS dos not read NTFS formated drives. You need to create a NTFS boot up disk to access the files on the HD. Or if you can boot the system in safe mode and try to copy the files to a floppy. But you are limited to only 1.3mb on a floppy. You can slpit the file if it is bigger then a single floppy can hold using multiple floppys..


Good luck
5833.

Solve : Batch to Run 3 Programs?

Answer»

So This?:
Code: [Select]@echo off
Choice /M "Do You Want To Run Mac Look-Alike Programs?"

If %errorlevel% EQU 2 goto no
If %errorlevel% EQU 1 goto yes


:yes
start "" "C:\Program Files\Mioplanet Battery Meter\Mioplanet Battery Meter.exe"
start "" "C:\Program Files\Pixoria\Konfabulator\YahooWidgets.exe"
start "" "C:\Program Files\Stardock\ObjectDock\ObjectDock.exe"
exit

:no
exit

That way it doesn't matter what order Code: [Select]If %errorlevel% EQU 2 goto no
and Code: [Select]If %errorlevel% EQU 1 goto yes are in?
You got it.

But I don't KNOW what the /M switch does in CHOICE.EXE. My version does not have it.

Quote from: Dias de verano on August 22, 2008, 10:30:27 AM

You got it.

But I don't know what the /M switch does in CHOICE.EXE. My version does not have it.



Code: [Select]choice /m "What Is Your Choice?"
/m must come after CHOICE to indicate that the passage in quotes is the displayed message according to my system ( Vista Home Premium )

It has CHANGED then. I have the Windows 98 choice.exe

Code: [Select]CHOICE [/C[:]choices] [/N] [/S] [/T[:]c,nn] [text]
This is Vista choice.exe option text

Code: [Select]CHOICE [/C choices] [/N] [/CS] [/T timeout /D choice] [/M text]AH, yes WIn98 Choice command needs no /mHere is another way you can start your 3 programs




@ECHO off
cls

:start
ECHO.
ECHO Y. Start Programs
ECHO N. Exit
set choice=
set /p choice=Type Y or N to run programs or exit.
if not '%choice%'=='' set choice=%choice:~0,1%
if '%choice%'=='y' goto progrun
if '%choice%'=='n' goto bye
ECHO "%choice%" is not valid please try again
ECHO.
goto start

:progrun
start "" "C:\Program Files\Mioplanet Battery Meter\Mioplanet Battery Meter.exe"
start "" "C:\Program Files\Pixoria\Konfabulator\YahooWidgets.exe"
start "" "C:\Program Files\Stardock\ObjectDock\ObjectDock.exe"
goto end

:bye
ECHO BYE
goto end

:endThat code works perfect also, but I have also edited the other code a bit.
Code: [Select]@echo off
title Macilizer
echo Macilizer starting...
ping -n 1 -w 2000 1.1.1.1 >nul
echo Initializing...
ping -n 1 -w 500 1.1.1.1 >nul
Choice /M "Do You Want To Run Mac Look-Alike Programs?"

If %errorlevel% EQU 2 goto no
If %errorlevel% EQU 1 goto yes

:yes
echo Starting Battery Meter
ping -n 1 -w 2000 1.1.1.1 >nul
start "" "C:\Program Files\Mioplanet Battery Meter\Mioplanet Battery Meter.exe"

echo Starting Konfablator
ping -n 1 -w 2000 1.1.1.1 >nul
start "" "C:\Program

echo Starting Object Dock
ping -n 1 -w 2000 1.1.1.1 >nul
start "" "C:\Program Files\Stardock\ObjectDock\ObjectDock.exe"

ping -n 1 -w 2000 1.1.1.1 >nul
echo Exiting....
ping -n 1 -w 2000 1.1.1.1 >nul
exit

:no
echo Exiting....
ping -n 1 -w 2000 1.1.1.1 >nul
exit
5834.

Solve : run a program in a .bat file...read on?

Answer»

Ok, I want to make a .bat that runs Pinball. I have this...

pause
start /MAX C:\Documents and Settings\All Users\Start Menu\Programs\Games

But it says that it cant find the C:\Documents and Settings.....any ideas?Quote

Ok, I want to make a .bat that runs Pinball. I have this...

pause
start /MAX C:\Documents and Settings\All Users\Start Menu\Programs\Games

But it says that it cant find the C:\Documents and Settings.....any ideas?

Wow, I might actually know this one... is the "C:\Documents and Settings\All Users\Start Menu\Programs\Games" in quotation marks?If you want to use the shortcut, the line should be:
"C:\Documents and Settings\All Users\Start Menu\Programs\Games\Pinball.lnk"
Note: that you left off the name of the shortcut: Pinball.lnk

But, why not skip the start menu & shortcut all together. Go to Start, Programs, Games: Them Right CLICK on Pinball, Properties. The TARGET should be highlighted already. Right Click on the target name, Click Copy. Then paste the target into your batch file. In XP it will be: "C:\Program Files\Windows NT\Pinball\PINBALL.EXE". It could be different in other Installations. I usually skip the start COMMAND. I don't know why, but it seems to work better without it.

Correction on 04/05/2008:

Do not skip the start command when starting a program in a batch file. It does NOT work better without it.

For more information see the following more recent topic with a similar problem & resolution.

I need help again with a script file... ANYONE STILL UP TO HELP ME??
Ah, I know that looked a little wrong.

Yeah, I think TARGETING the actual .exe in your program files should be better. I don't know if it will make much difference in this specific context, but if you happen to move or delete a shortcut but the program is still installed, it'll still give ya an error, whereas if it was linked to the program, it'd be fine. I'm always moving around the shortcuts on my desktop, and it would be a pain if I had to CHANGE my .bat file every time.It helps actually using the 'start' command because then the CMD window will close after the game opens up.Use the /B switch, And the command window won't open up at all.
START /B DRIVE:\PROGRAM.XXXI'm not familiar with /B (I'm pretty much a neophyte myself...) what does that stand for? in what context can I use it?Try Start /? first. Then experiment. Trial and error is your best teacher. I spent about 10 hours on my last batch file, writing, reading help, testing, and debugging a little bit at a time.If all you are really trying to do is run pinball, why not just put a shortcut on the desktop?
5835.

Solve : dos copy cmd and long folder/filenames?

Answer»

in win xp at the command PROMPT I'm attempting to create a batch file that does this:

copy F:\Access Database\Premier Assets Management XP.mdb C:\Access Database\Premier Assets Management XP.mdb
(f: being the shared network drive and c: being the individual workstations)
the files and folders having the long filenames seem to be an issue. i tried substituting ?, _ , ~ in place of the spaces with no luck. helpCode: [Select]copy "F:\Access Database\Premier Assets Management XP.mdb" "C:\Access Database\Premier Assets Management XP.mdb"

Good luck. thanks, apparently i need itI am having the same problem and I have tried the PREVIOUS post's format with no luck. This is my command, below, (I'm running it from a dos batch file initiated at the windows explore window (right-click on Start, then Explore)). The response I get is "The system cannot find the file specified". This should be the correct path - I copied and pasted from the windows explore address box to be sure. I'm trying to copy files from a network drive to local.
I've been struggling with this for some time. If anyone can help me out with this I'd be so grateful.


G:
copy "G:\FORMS\ken\LMC Smart Design\*.*" "C:\LMC Smart Design\*.*"Quote from: lgbailey on February 13, 2008, 08:21:58 AM

copy "G:\FORMS\ken\LMC Smart Design\*.*" "C:\LMC Smart Design\*.*"

You can LOSE the bit in red, not needed and may be stopping the command working.
thanks for everyones help, this is what worked:


Code: [Select]:begin
cls
cd F:\"Access Database\"
copy "Premier Assets Management XP.mdb" C:\"Access Database\"
start /max c:\"program files\microsoft office\office12\msaccess.exe
c:\"access Database\Premier Assets Management XP.mdb"
:end
Dias de verano: Yes, I think you were right about removing the "\*.*" from the end of the command. That was part of the problem. The other part was I needed to copy subfolders so I changed the command to xcopy ENDING with /e and that worked like a charm. Thanks so much for putting me on the right TRACK.
5836.

Solve : how to set input parameter in batch?

Answer»

Hey all,

I'm wondering if there is a way to set INPUT parameters up in a batch script. Here's the general idea as output of the application:

Code: [Select]C:\USERS\***\Documents>interactiveConsoleApp
$>SOMETHING
doing something...
$>something else
doing something else...
$>quit
C:\Users\***\Documents>

What I want to do is create a batch script that would pass those parameters ("something" and "something else") into the application. Is this possible?
You mean you have a program that takes input parameters from the command line and you want to do it from a batch file?

Like this?
Quote



Breakfast.exe eggs cheese ham

Lunch.exe steak potatoes "apple pie"


That sort of thing?

No these are not parameters that would be called as arguments for the application. Maybe a good example would be the MySQL command line tool, where you ENTER a few parameters initially, but you can do multiple SQL statements within the tool itself. Here's another example:

Code: [Select]C:\Users\***\Documents>consoleApp -u=username -p=password

$>call method in consoleApp
method was called

$>obtain network rights
rights obtained

The lines where I obtain network rights or call method in consoleApp wouldn't be called as arguments to the application, but would be interaction the USER takes typically after the application is running.OK I'm with you. Like telnet, where you open a console? there is no generic way of doing this.

You could try a pipe which works with some programs but not others

echo command1 > myfile.txt
echo command2 >> myfile.txt
echo command3 >> myfile.txt
echo quit >> myfile.txt

type myfile.txt | consoleApp -u=username -p=password

Something like that, although I have a feeling that the username and password stuff might get in the way, but you could experiment.



5837.

Solve : bat file IF statement need help?

Answer»

Hi,
I use a DOS program which CONVERT a imege format. And I tried to create a bat file which need to call for instance xxx.exe -parameter . The parameters is the imege resolution and it is a part of the image name. If the image begin whit 1_ resolution is 80X60, 2_ resolution is 120x80 and so on. Here is what I try so fat(doesn't work):

For %%F in (*.*) do goto next
:next
IF %%F == 1_*.* xxx.exe %%F 60x80
IF %%F == 2_*.* xxx.exe %%F 120x80
......

I desperately need help. Thanks to any one who can help me..




You do not say what OS you are using. This should work in Windows 2000 and later. Notice ! instead of % for variables inside loop. Also notice line starting "setlocal".

To get M chars of variable starting at position N (1st position is 0)

%variable:~N,M% [or !variable:~N,M! inside a loop, if you have enabled delayed expansion as SHOWN below]

So...

if %string% is HELLO WORLD
then %string:~1,3% is ELL

Quote


@echo off
setlocal enabledelayedexpansion
for /f "delims==" %%F in ('dir /b') do (
set filename=%%F
if "!filename:~0,2!"=="1_" set res=60x80
if "!filename:~0,2!"=="2_" set res=120x80
REM and so on all for your resolutions...

REM now call the program
xxx.exe !filename! !res!

)

Thanks that works great.
But what about if I need to check for string in any position in the file name.
Example: Find if "abc" is a part of the all file names in the current directory. OS Windows XP
can I do something like:

setlocal enabledelayedexpansion
FOR /f %%F (*.*) do (
set filename=%%F
IF filename condition "abc" command

What will be the condition if it
Thanks..You can use && and || operators

[Operation] && [do this if operation was successful]

[Operation] || [do this if command was not successful]

Do something if abc IS found...

use >nul to stop echo to screen

Quote

setlocal enabledelayedexpansion
FOR /f %%F (*.*) do (
set filename=%%F
echo !filename! | findstr "abc">nul && command


or if you have more than 1 command to execute...

This is the general way to execute more than 1 command after a TEST

Don't forget to count parentheses (( ))

Quote

setlocal enabledelayedexpansion
FOR /f %%F (*.*) do (
set filename=%%F
echo !filename! | findstr "abc">nul && (
command1
command2
ETC
)
)


Do something if abc IS NOT found...

Quote

setlocal enabledelayedexpansion
FOR /f %%F (*.*) do (
set filename=%%F
echo !filename! | findstr "abc">nul || command


or if you have more than 1 command to execute...

Quote

setlocal enabledelayedexpansion
FOR /f %%F (*.*) do (
set filename=%%F
echo !filename! | findstr "abc">nul || (
command1
command2
etc
)
)

Of course you can do this instead of having the sought string in the test itself

Quote

setlocal enabledelayedexpansion
set trigger=abc
FOR /f %%F (*.*) do (
set filename=%%F
echo !filename! | findstr "%trigger%">nul && command

5838.

Solve : Running Virus Scan in MS Word!?

Answer»

HI, i tried searching for answers but no luck. i noticed for about 4-5 months now EVERY time i OPEN a word DOCUMENT in MS word 2003 it takes a long time to come up! and at the bottom left it displays a text "running virus SCAN" is there a way to turn this off? i have only one anti-virus software installed "NOD32" but i had this anti virus software installed for more than two years now. i have another computer at HOME but don't have this situation. Than in advance.

BassGo into NOD32 settings and disable DMON (Document Monitor).


Thank you very much, it worked!Wicked!!! Glad to help.

5839.

Solve : need help on notepad/batch?

Answer»

so i was wondering if there was a way to open note pad and it will aready have
@echo off



is there a way
thx in advSo like when you open notepad from the start menu, it will already have @echo off already TYPED? lol, you must program batch files a lot to need this....
I don't think there is a way but it isn't really a hassle to have to type @echo off, is it?hmm
i wonder if changing the notepad itself is suitable?Quote

so i was wondering if there was a way to open note pad and it will aready have
@echo off



is there a way
thx in adv


1.) Make a text file, containing that one LINE
@echo off. Name it temp.txt

2.) At the command line, type notepad temp.txt
and Notepad with start, with that file opened.

3.) ADD whatever text you want.

4.) SAVE with Save As , not Save



Btw, if you are doing MUCH work at the command line, instead of fooling around with the Windows editor, i.e. Notepad , why not just use Edit ? That way you are not having to flip back and forth with windows.






5840.

Solve : how to add with batch file???

Answer»

the title says it allI don't get it...ADD what to where from where??? More details lollike how do u add 1 and 1 or 200 and 20oh lol, then you could use the set command like the following:

@echo off
set /a a=1+1
echo %a%
pause

I'm sure you can modify it so you can choose the NUMBERS to add. I've already got one but i'm going to let you figure out how to do it. If you want my code, message me thanks works perfectno prob, you can do quite a lot with the 'set /a' command.This works with the NEWER 'dos' command prompt, and if you have that, is the easiest.

If ever you are WORKING with MS-DOS, or even a command prompt on an older version of Windows, it will not work.

I thought you might like to know about another way. A free utility program. It does a LOT more than just simple math too. Very handy to have.

http://www.ferg.org/fdate


I hope that helps.





Yeah i got fdate, really cool.

5841.

Solve : Export directory contents?

Answer»

Hi,
I wonder if anyone can help.
I have a very simple batch FILE that takes all .pdf files from a directory (the directory contains LOTS of different file types) and CREATES 'CORR.TXT', which contains just the pdf's:
DIR \\mydir\*.PDF /O:N /B > \\mydir\CORR.TXT
However, CORR.TXT contains the full file name eg. 1.pdf etc. What I need is to drop the .pdf extensions in CORR.TXT as I need to link the .txt file into MS Access.
Is this possible to do during the creation of the .txt file or can this be DONE after it has been created ?

Any help would be appreciated.i would suggest something of the following nature:

1) rename the files in the directory from xxx.pdf to just xxx (i.e. rename sans extensions)
2) run the .bat to copy the file names
3) rename the files again adding the extensions (xxx to xxx.pdf)

this isn't the prettiest or safest way to do it, but it's better than nothing. also, if you're dealing with a large number of files, it could get ugly...

good luck
-darryltry this? :
Code: [Select]for /F %%I in ('dir /B /A-D c:\yourdir\*.pdf') do (echo %%~nI)

5842.

Solve : '|' in cmd?

Answer»

Is it possible to put 'an '|' in COMMAND prompt.
For example:
QUOTE

@echo off
echo. |
pause
Doesn't WORK, it says syntax error or something. Anyone know how to do it?

Thanks in advanceyes , just put ^ before |
eg
echo ^|OH sweet, thanks Ghostdog
5843.

Solve : My computer died!! HELP!?

Answer»

Hello, I was playing a game yestoday night. And when I was playing my computer frooze so I shut the computer down by the electric. And now when I try too start the computer it wont load. I got a blue botton I press when the computer gonna start that blue botton is blinking(it blinks like that when the computer is in sleep MODE) and the start botton for my screen goes orange (it goes orange when its in sleep mode too) and the screen is just BLACK..
I use Windows XP home editon.. Help please!
Oh I CLOSED all electric and then took it on again. the computer WORKS now. but the screen still goes orange.. what too do?? I find out something more. precisly when I start the screen it says "Entering saving mode" and then it TAKES 7sec and then its in saving mode.. dosnt work with a mouse click or keyboard click...help

5844.

Solve : Text to speech program.?

Answer»

Dear All !

Greetings !!

What is the text to speech program, how it BUILD up and in which language ?
How it works.

any LINK ..

Thanks n Regards,
Jay

Are you talking about the Speech program in the Control Panel? I THINK you can download language and voice packs off the web, but I haven't really used the thing before.

If not I think their are lots of programs on the web that do this, but you'd have to SPECIFY which ONE you're talking about.

5845.

Solve : cmd.exe not functional?

Answer»

The cmd.exe in my pc is not functioning. Every time I enter a valid dos prompt and press enter, the next line will show (name of the command) is not recognezed as an internal or external command, operable program or batch file. I cannot recall if anything has been changed before that.

Any suggestion of fixing it?

My OS is Win XP Professional.

HenryhauwQuote

The cmd.exe in my pc is not functioning. Every time I enter a valid dos prompt and press enter, the next line will show (name of the command) is not recognezed as an internal or external command, operable program or batch file. I cannot recall if anything has been changed before that.

Any suggestion of fixing it?

My OS is Win XP Professional.


Henryhauw


Even with something LIKE dir ?
Try that, post back .... what happened?



Next, try path , then hit enter. What happened? Post back here what appears on screen.



Sorry. Some of the commands such as dir , path, are ok. But some are not functional.

Below are some examples copied for the cmd dos page:


Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\Hauw.COMPUTER>path
PATH=Path=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem

C:\Documents and Settings\Hauw.COMPUTER>dir
Volume in DRIVE C has no label.
Volume Serial Number is 44B8-45B7

DIRECTORY of C:\Documents and Settings\Hauw.COMPUTER

07/15/2006 06:28 PM .
07/15/2006 06:28 PM ..
12/24/2006 05:13 PM .housecall6.6
07/15/2006 06:06 PM Start Menu
07/16/2006 09:44 PM My Documents
07/16/2006 09:44 PM Favorites
07/15/2006 06:06 PM Desktop
03/15/2007 12:02 AM 4,456,448 ntuser.dat
07/30/2006 12:27 AM Contacts
01/23/2007 09:54 PM boran-remover
02/25/2007 05:17 PM 0 getservice.txt
2 File(s) 4,456,448 BYTES
9 Dir(s) 2,679,857,152 bytes free

C:\Documents and Settings\Hauw.COMPUTER>ipconfig
'ipconfig' is not recognized as an internal or external command,
operable program or batch file.

C:\Documents and Settings\Hauw.COMPUTER>ping 127.1.1.0
'ping' is not recognized as an internal or external command,
operable program or batch file.

C:\Documents and Settings\Hauw.COMPUTER>help
'help' is not recognized as an internal or external command,
operable program or batch file.

C:\Documents and Settings\Hauw.COMPUTER>cd..\

C:\Documents and Settings>cd..

C:\>

Any clue?

HenryHauwQuote

- - -

C:\Documents and Settings\Hauw.COMPUTER>path
PATH=Path=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem

- - -

C:\Documents and Settings\Hauw.COMPUTER>ipconfig
'ipconfig' is not recognized as an internal or external command,
operable program or batch file.

C:\Documents and Settings\Hauw.COMPUTER>ping 127.1.1.0
'ping' is not recognized as an internal or external command,
operable program or batch file.


Any clue?



Use the Search within WinXP... MAYBE it is called Find .
Search all your hard drives when you search.

Have it look for ipconfig . If and when it finds it, note the
directory.

Same for ping .


Now compare those directories to those listed in your path. See them there, as the result of your Path command? They are seperated by semi-colons.

When you execute a command, 'dos' first looks in the current directory for it. If not found, 'dos' then searchs the directories listed in the path variable. If it finds it, it runs it. If not, it reports back to you that the command was not found - which is what you are seeing.

In other words, something like ping must be in the path, or you must be in the same directory with it to run it.

I don't know about WinXP, but I would expect to find ping.exe
in C:\Windows .
According to your report, that directory is in your path.
So, ping should run..... if it exists there. So I'm wondering why it is not there. We'll find out if it exists, and where, when you search all your hard drives for it.



I think both Ping and Ipconfig are normally in the C:\WINDOWS\System32\ folder.I have run search. My ping, ipconfig and help are in several directories. One of them is C:\windows\system32. After I copied them to C:\windows, they run ok. I wonder why they were missing from C:\windows folder and how many more commands have been affected.

Anyway, Many thanks.

Henryhauw
5846.

Solve : rename directory with date?

Answer»

If I want to rename a directory name that changes every week, how can I do that? I have tried just about every combination of masks and wildcards I can think of. It has got to be a lot easier than I am making it.

I need to rename a subdirectory that has the date (which changes) ie: 3-17-07 to a one word name like: show .

I can do: ren 3-17-07 show

But the subdirectory changes every week so I need some kind of a mask or wildcard to do it.

Thanks..Quote

If I want to rename a directory name that changes every week, how can I do that? I have tried just about every combination of masks and wildcards I can think of. It has got to be a lot easier than I am making it.

I need to rename a subdirectory that has the date (which changes) ie: 3-17-07 to a one word name like: show .

I can do: ren 3-17-07 show

But the subdirectory changes every week so I need some kind of a mask or wildcard to do it.

Thanks..

This doesn't work for you:
ren ??07 show

I just tried it, and it WORKS for me. What version of 'dos' are you using?

Also tried move *07 show and that worked too.


If you need to get that date into an environment variable, so you can specify the exact DIR name - you can do that with a free utility program, Fdate. See: http://www.ferg.org/fdate
If you are using WinXP, you can get the date into an environment variable without Fdate, but since I don't use XP I won't attempt to explain that - you can probably find it explained here in these forums though. It comes up every now and then.

Fdate is well documented. Along with plenty of examples. It does a LOT more than just get the date too. If you get the hang of it, you find it is a very handy tool to have.
And the price is right.

I hope this helps.

Hi,

Thanks for the response. The problem with the ren and "?" filemask is that the composition of the date structure changes. It could be a single digit month or a double digit. Additionally, the ren command did not work for me.

I did find the "move" command. It works perfectly, although I had to run two of them in the batchfile to accomodate for the additional character in the date (like 12-07-07).

It works now.

Quote

Thanks for the response. The problem with the ren and "?" filemask is that the composition of the date structure changes. It could be a single digit month or a double digit. Additionally, the ren command did not work for me.

As far as ren not working - you forgot to answer the question about which version of "dos" you are using.

Honestly, I was surprised it worked here. Using Win98SE.

Only reason I tried it was because you mentioned it.
In my mind, the way to rename directories was with the move command. That could be something left over from many years ago with plain old MS-DOS - - not sure now.

Quote
I did find the "move" command. It works perfectly, although I had to run two of them in the batchfile to accomodate for the additional character in the date (like 12-07-07).

Sounds like you are using the ? , not the * .
The question mark is for one character, the asterisk is for all characters.


Quote
It works now.

And this is the bottom line.
Glad you got it going - one way or another. Thanks for posting back.





I think your dating yourself, as I am. I miss my C:> prompt. It was so cold and impersonal. * God Bless Bill Gates*

As for the DOS version, sorry. It is whatever comes with XP Home. I tried it numerous times with the filemask variables. I could only do it when I specifically used the complete directory name.

Anyway, as you stated, it works. Could be the reason I was kicked out of my Pascal and Cobol classes. I am not, and do not ever want to be, a programmer. Quick and dirty is my theory. I flunked one class project - it was some simple manipulation of database problem. It took me over 300 lines of code to do it. The answer was only 30 lines.

But mine worked too and it had color graphic responses. (I love the IF THEN ELSE statement.)

Thanks again.Quote
I think your dating yourself, as I am. I miss my C:> prompt. It was so cold and impersonal.

Yes, I probably am dating myself. But that C: prompt worked! without a lot of complicated extraneous stuff.


Quote
* God Bless Bill Gates*

Stay away from www.linuxquestions.org forums with that.


Quote
As for the DOS version, sorry. It is whatever comes with XP Home.
I tried it numerous times with the filemask variables. I could only do it when I specifically used the complete directory name.

I don't have XP, so based on what you say and what I just tried on Win98, there must be something different about how their respective command interpreters handle it.

Quote
Anyway, as you stated, it works. Could be the reason I was kicked out of my Pascal and Cobol classes. I am not, and do not ever want to be, a programmer. Quick and dirty is my theory.

Get yourself a copy of Fdate.
The first time through, it might take you a few minutes to configure.
It has a LOT of options is all.
But after that, you might find yourself like me - I keep it (and a few other handy programs) in a 'utils' directory in my path.

Quote
I flunked one class project - it was some simple manipulation of database problem. It took me over 300 lines of code to do it. The answer was only 30 lines.

But mine worked too and it had color graphic responses. (I love the IF THEN ELSE statement.)

Thanks again.

np. Glad you got it. And I hope that you don't have to run it twice now, if you've tried using the asterisk with move , instead of question marks.



Sorry Sir,

Another question

If I want to rename a file name to today's date

ex: ren show "today's date"

How can I use the command.

tks.
Quote

Sorry Sir,

Another question

If I want to rename a file name to today's date

ex: ren show "today's date"

How can I use the command.

tks.



For your future benefit, KNOW that it is best to start a new thread with your question. That way it gets NOTICED, and your question gets the attention it deserves. It is also less confusing as others come along and read the current thread.

Since your question is easy to answer, here you go:

1.) It can be done, using the command line, under WinXP. I don't
have WinXP, so don't feel comfortable trying to talk you
through it. You can search the forums here, as it has come
up before, and you will likely find the answer.

2.) The way I do it works under not only WindowsXP, but older
versions of MS-DOS, and the 'dos' that comes with older
versions of Windows.
Go here: http://www.ferg.org/fdate/index.html
and download a free utility program. It does a LOT more too.

To answer your SPECIFIC question, go here:
http://www.ferg.org/fdate/index.html#faqs
The first example given in that FAQ is exactly your question,
answered.


I hope that helps.






5847.

Solve : Looking up IP add through Yahoo Messanger/webcam/?

Answer»

hey i have been told that you can find out the person you are speaking to/viewing cam/yahoo messanger/etc by doing something on DOS to figure whose your COMPUTER is connectted to. Is there any TRUTH to this?You can type netstat in command prompt and you would have to look for it...may i ASK why you need their IP address?where would you like to know that?
i SMELL something fishy

5848.

Solve : How can I run a DOS program in custom size window??

Answer»

Quote

No - not "pulling" anything. You wrote that you copied it, and I read what you wrote. It seems that I did understand it correctly too.

Err... I think we're going off track here? I don't think this comment was in any way relevant to the problem & I don't wish to sidetrack into a completely different debate simply because the original posting is perhaps becoming EXHAUSTING for you (exhausting as in boring before you "pull" me on that).

Quote
That wasted a lot of TIME and posts.

Again, pointless comment & incorrect. In what way have I wasted time & post's by simply abbreviating a set of words? If I describe something as 'crap' but it's called 'crappycrapcrap' how does that waste time or affect you? your not the one using the words to achieve something are you? I am.

Quote
Ok - if you've got the Command Line entry so that it points to the batch file that launches your game, and you've got the WORKING entry so that it points to the directory where your game resides, then that is what you need to do.
That's all I've been trying to ascertain. If it won't run now, then you need to examine everything closely, looking for the error.

Oh dear, this relationship is going down the PAN isn't it? You would have 'ascertained' this much sooner, if you'd read my PREVIOUS post's, and 'looking for the error'? I thought I'd been doing that all along!

Quote
Perhaps 2K_dummy has been following along and will have some advice.

Yes, I hope so...
5849.

Solve : cant change directories on ntfs4dos boot disk?

Answer»
Im TRYING to execute diskpart.exe USING ntfs4dos. When I boot the computer with the floppy it wont let me change DIRECTORIES from the a prompt. I can type in CD c and it will change to c but then changes right back to a. I can also do dir command and it will show all the files in the dir but it wont let me change from a prompt.Welcome to the CH forums.

What are you trying to do?

CD C means "Change to Directory C on the current drive" do you have a directory named C on the floppy?

If you want to change to DRIVE C: you must enter C: WITHOUT CD.

Good luck.

haha thanks for helping a total newb
5850.

Solve : Re: Unique sort using MSDOS?

Answer»

Quote

How can I use MSDOS to sort a file unique ?

Can you EXPLAIN a bit? not sure what you are asking for.Looks as if the original message was deleted. However I'd ASSUME BASED off what was in the quote that maybe they were wanting a sort by file type.

For example listing only executable files ( dir *.exe ). But that's just a guess. Since user deleted message may really NEVER know.