Tech Problem Aggregator

copy yesterday's file daily with the dos command/batch file

Q: copy yesterday's file daily with the dos command/batch file

Hi Guys,

I want to make one batch file which daily copies yesterday's files from one folder & paste it to another folder.

I.e.
C:/111 folder has following files.
1.zip had yesterday's date
2.zip had yesterday's date
3.zip had last sunday's date

now, when i will run batch file today, it only copies 1.zip & 2.zip & move to another folder C:/222

So C:/222 contains following
1.zip had yesterday's date
2.zip had yesterday's date


Please note , i have to run this batch file daily which should not require any changes.

More replies
Answer Match 79.5%

What is the command to copy a file from a ThinApp location?
example:
copy "C:\Documents and Settings\all users\Start Menu\PortableApp\Thinstall\Application\%StartMenu%\PortableApps\Register.mny" "Y:\PortableApps\file"
This example does not work, I guess it is because of \%StartMenu%\. Any suggestions

Thanks,

jjblack
 

A:batch file copy command

8 more replies
Answer Match 79.5%

hello every onei am just started to learn about batch files, and done some really basic ones So i was just trying out the copy command just to try one for myself, but seem to be getting stuck"EXAMPLE" I WAS TRYING TO COPY C:\TEMP TO C:\Documents and Settings\ROWLEY.PRIVATE-3264A01\My Documents I also tryed copy c:\temp to c:\my documents. but as i am new to this i am doing something wrong can anyone shed any light on this for me. i am using windows xp. Copies one or more files to another location.COPY [/A | /B] source [/A | /B] [+ source [/A | /B] [+ ...]] [destination] [/A | /B]] [/V] [/Y | /-Y]source Specifies the file or files to be copied. /A Indicates an ASCII text file. /B Indicates a binary file. destination Specifies the directory and/or filename for the new file(s). /V Verifies that new files are written correctly. /Y Suppresses prompting to confirm you want to overwrite an existing destination file. /-Y Causes prompting to confirm you want to overwrite an existing destination file. The switch /Y may be preset in the COPYCMD environment variable. This may be overridden with /-Y on the command line.To append files, specify a single file for destination, but multiple files for source (using wildcards or file1+file2+file3 format).Examplescopy *.* a:Copy all files in the current directory to the floppy disk drive.copy autoexec.bat c:\windowsCopy the autoexec.bat, usually found at root, and copy it into the windows director... Read more

A:Batch File Copy Command

The copy command works on files, not on directories. So, for example, if you wanted to copy all the files in the Temp directory (NOT A GOOD IDEA, BTW - it'll copy a whole bunch of nonsense stuff) to your My Documents folder the syntax would be:

COPY C:\TEMP\*.* TO C:\Documents and Settings\ROWLEY.PRIVATE-3264A01\My Documents\*.*

This will copy everything in the C:\Temp directory to the My Documents directory that's indicated here. The use of the wildcards of *.* means that it will copy everything with entries before the . and everything after the .

It'd be a better experiment (IMO) to just copy 1 text file from the Temp directory to the My Documents directory. In this case it'd be:

COPY C:\TEMP\filename.txt TO C:\Documents and Settings\ROWLEY.PRIVATE-3264A01\My Documents\*.*

You'll end up with a document named filename.txt (if it exists in your Temp directory) in your My Documents folder.

Just for experimentation, try typing "dir *." (without the quotes) at the command prompt. It'll give you a listing of the directories that are located within the folder that your command prompt is open to.

2 more replies
Answer Match 107.94%

I'm trying to write a .bat that's supposed to handle the very simple task of copying a file to the desktop.

Something like:

copy x:\folder\file.ext [desktop]\file_backup.ext

The problem: [desktop].

It would be really easy if I could simply insert %desktop% the same way as %windir% etc. Unfortunately, %desktop% doesn't exist.

Using the variable for userprofile doesn't work either, because the user may have moved the desktop folder out of the docs & sets folder to any other location, and not necessarily on the same partition or drive.

It would be easy in a .vbs, but that won't work if the windows script host is locked down or disabled.

So it has to be a batch file. Does anyone know how to explain a .bat how to find the desktop?
 

A:Batch file: how to insert desktop location into copy command

16 more replies
Answer Match 103.32%

Hi,
I have a question  that how to copy file from remote desktop user drive to my local machine using  xcopy or any other protocol.

This is my server path "\\Trail01" and here is the file location "c:\Users\ashique.sheikh\Desktop\Day2.R"
How can i give this is in my batch file. I have used this
net use "\\Trail01" "[email protected]" "/USER:ashique.sheikh"
XCOPY /Y \\Trail01\c:\users\ashique.sheikh\Desktop\Day2.R  "D:\VMI"
But its not working. It is give path error.
How can i download this or is there any other way to do it?

More replies
Answer Match 98.28%

Hi all,

Any idea how to write Batch File .bat to copy file from File Sharing & FTP Hosting to local directory.

Current the File Sharing & FTP Hosting is SMARTFILE.

I don't want to use WINSCP as the connector.

Thanks

A:Batch File .bat to copy file from File Sharing & FTP Hosting

Hi Chacha,

Give this batch file a try. All text in red, you should adjust before running.


Code:
@echo off
(
echo.Username
echo.Password
echo.lcd C:\Some\local\directory
echo.cd /Some/server/path
echo.binary
echo.get Some_file_to_download.txt
echo.bye
) > "%TEMP%\_%~n0.ftp"
ftp -s:"%TEMP%\_%~n0.ftp" "12.34.56.78"
del "%TEMP%\_%~n0.ftp"

1 more replies
Answer Match 97.02%

I am wondering if anyone can provide the equivalent to this linux script. When run against a text file with one entry per line being the name of a directory, it deletes the named directories.

On linux, I run this against the text list.
#!/bin/bash
while IFS='' read -r line || [[ -n "$line" ]]; do
rm -R $line
done < "$1"

I am not sure how to make it do the same for Windows. I can do this, but I'm hoping there's a way to delete based on what's in the text file. Also, wouldn't want it to prompt for deletion of each, but to just delete.

@echo on
cd \
cd %USERPROFILE%
dir /D /N 0
pause
for /D %%f in (XX*) do rmdir %%f /s
pause
%comspec% /k
pause


Thank you

A:Batch file or command to delete directories named in a text file

It's easiest to clean out the files before removing the directory.
echo Y|del *.* will clean out the files in a directory as long as there are no hidden or system files, you need to remove the attributes of files with the attrib command before the bat will delete the directory.
the echo Y| simply answers yes to any confirmation messages

1 more replies
Answer Match 95.76%

Any suggestions here would be appreciated but I think this is so bizzare or deep into Windows that I'm not expecting any. I am developing a scheduled task that will run every morning unattended. The script starts Excel and specifies a workbook to open. The 'workbook_open' event runs and when finished, starts another batch file (via Shell(batFile, 1) and shuts down Excel. The 'batFile' starts Access and specifies the database to open. The database runs an AutoExec function and then shuts Access down. This sequence runs fours times for four separate databases. Here's the problem:

When the scheduled task runs under my account, everything works fine. However, when we change the scheduled task to run under the System Administrators account (we have to do this for reasons not important here), the Excel/Access sequence for one, and only one, of the databases does not run. I have isolated the problem to the 'Start' commands for both Excel and Access. What appears to be happenng is that for the Excel 'Start', Excel starts but the 'specified' workbook is not opened, hence Excel just sits there as an open process not doing anything. When I changed the name of the 'specified' workbook, the Excel 'Start' works okay, opening up the renamed workbook. The same thing happens with the Access 'Start' command. Access starts but the 'specified' database does not open, hence Access just sits there ... Read more

A:DOS Batch 'Start' app file command cannot find file

I've found a workaround to this problem by renaming the parent folder to which the database's location folder trees. But I sure would like to know what caused this problem.
 

1 more replies
Answer Match 95.76%

I need to write a batch file or vb script that will take the following share names (which are stored in a .csv Excel file) and then run the following command:

NET USE \\[entry from 1.csv file]

The object is to have this command establish a NET USE connection to each share name from the 1.csv file.
These are the first five entries from the 1.csv file:
\\s0002234\c$
\\s002631\c$
\\gb2130\c$
\\s00460\c$
\\gb2143\c$
\\gb3205\c$

Can you please write a command script that will do this for me? My OS is Windows XP Service Pack 2.
Contact me with any further questions.
Dennis
[email protected]
 

More replies
Answer Match 94.92%

Hi all,

Please help!! I'm having a problem to copy some files from a folder.
My folder have lots of files and is there any way for me to write a batch file to copy only files according to "date modified"? For example last week files or yesterday files.

Please help!! Urgent!!!
Thank you.
 

A:Urgent!! Copy file by date modified using Batch File.

Take a look at XXCOPY: http://www.xxcopy.com/index.htm
 

2 more replies
Answer Match 94.08%

Hi,
I am new to batch files and have read up a little on xcopy and robocopy. 
We currently have a folder which new builds are copied and compressed to .zip files and stuck in a  folder. Dozens of zip files are created every day
What I want to do is the following:

I want to copy the newest zip file from folder 1 to folder 2 and extract it. 

What is the simplest way to find and copy the newest zip file considering multiple zip files are created each day?

A:using a batch file i would like to copy the newest file to a new location.

Try this:
@echo off
for /F "delims=" %%a in ('dir  /b /od "d:\My Files\*.zip"') do set Youngest=%%a
xcopy /y "d:\My Files\%Youngest%" "Folder2\"

3 more replies
Answer Match 93.66%

I have a folder with sequentially named images (a0001, a0002, a0003, etc.) and I was wondering if there was a way to delete every 3 files without touching the others.

So for example, I have: a0001, a0002, a0003, a0004, a0005 a0006, a0007, a0008, a0009

And after I would like to have: a0001, a0005, a0009

I've seen a couple batch files around that don't do exactly the same thing, but I'm not sure what I would need to modify.
 

A:Batch File/Command: Deleting every Xth file

Would like to see the examples you saw. But what I would do is setup a for loop to list all the files in the directory. setup a counter. When the counter does not equal one delete the file. after you have deleted the 3rd file (essentially the 4th file in the list) reset the counter back to zero.
 

1 more replies
Answer Match 91.98%

Help me make a batch file that copies a file from one computer to another computer in a network...

PC1 = Source
PC2 = Destination

I want to copy a file from PC1's Drive E: to PC2's Drive E:

A:How to copy a file from 1 pc to another pc in network using batch file

Yes I want to copy files from PC1 to PC2 over the network...

PC1's Drive E:\Online Games\Battle of Immortals\Battle of the Immortals
to
PC2's Drive E:\Online Games\Battle of Immortals\Battle of the Immortals

9 more replies
Answer Match 88.2%

hi,

I want to calculate the no of lines in a file. and also to read the last line of that file.

More replies
Answer Match 88.2%

So, I need a command for batch files, or other things that a batch file can link to, that selects another window, say a text window(notepad) and then can be typed into.
I've used the vbs scripting with
Set oShell = CreateObject("WScript.Shell")

oShell.AppActivate "Window name"

oShell.SendKeys "text~"
but it will get screwy if you are using the computer, it activates, and you activate a window other than in the vbs, and it sselecs everything, or does something. I need something that links to it, not "select it" like with a mouse click. I thank anyone who can help, even if the vbs is the only way.

A:In Need a batch file command

Tell us a bit more and maybe we can help you.

Where does the text being sent to notepad come from? Clipboard?

What do you do with the notepad window once the text has been sent to it?

9 more replies
Answer Match 88.2%

Hey Guys,

I have 3 DOS scripts that has to be merged into one .bat file . Basically i am trying to clean the temp files and getting the svn update and compiling and publishing the .net webapplication. below are my individual scripts.

to clean the file :

Code:
@echo off

echo *** Deleting ASP.NET temporary files (.NET 4.0)... ***

echo Deleting 32-bit files...
rmdir "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root" /Q /S

echo Deleting 64-bit files...
rmdir "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root" /Q /S

pause
to get svn update :


Code:
@echo off

cls
echo == Initiating system instance variables...
echo. -- Setting the variables...

:: Here you need to make some changes to suit your system.
set SOURCE=D:\Nutrition_Build\Trunk
set SVN=C:\Program Files\TortoiseSVN\bin

:: Unless you want to modify the script, this is enough.

echo. %SOURCE%
echo. %SVN%
echo. ++ Done setting variables.
echo.
echo == Updating source from SVN
echo. -- Running update...
"%SVN%\TortoiseProc.exe" /command:update /path:"%SOURCE%" /closeonend:2
echo. ++ Done.

echo. -- Cleaning up...
set SOURCE=
set SVN=
echo. ++ Done.
To compile and publish:

Code:
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Aspnet_compiler.exe -v / -p "E:\Sample\Myproject\Src" -u -f E:\BuildOutput\
Please help me on merging this three scripts into one file.

thanks.

A:DOS command in batch file

Looks like you could simply merge them as I don't see any branching being done (no goto).

3 more replies
Answer Match 88.2%

<This post has now been solved>


Hi,

Sorry if this is not the place but does anyone know how to do the following?

I am trying to create a batch file to search a directory for a specified file type and list it in a text file then get the batch file to read that text file and copy all the files it found to a directory.

i have created the following which does work... the problem is, when there is a space in the filename it says it cant find the file, i don't know how to get it to include spaces i would normally by using " ??


Code:
dir /s /b c:\source\*.txt >c:\files2copy.txt
for /f %%i in (c:\files2copy.txt) do xcopy %%i %%j %%k c:\dest
Any help will be greatly appreciated.

A:Batch File - For Command??

Hi JDobb, is there any reason that you cant do a two step process? Like create your list, then go back and have XCOPY work on the original directory. XCOPY is works fine for me with spaces in the file names, and it is designed to work on multiple files, where it looks like you are using it on individual files in the for loop.

xcopy "*.txt" J:\test\test2\*.*

here is a backup file that I use now and then

Code:
@echo off
@echo Process saver run history
@type 00SaveProcesses.log

echo.
echo this will backup the "Processes" folder to the primary backup (\\LEN\L)
pause
xcopy c:\users\PB\datapart\Processes\*.* \\len\Processes\*.* /s /d /y /f /c
::/y suppress overwrite prompting
::/f display full file names as copying
::/c continues on error
::/s subdirectories
::/d only newer files
echo complete %date% --- %time% >> 00SaveProcesses.log
I have several other varations of this basic idea if you work best from examples.

Caution, while you are working this out, Use the /L flag on XCOPY to check that it is going to work before running, or in your for loop

Code:
do @echo xcopy %%j ...
to show what it is going to do before you do it. Remember that the commandline has no pity, and it will eat your lunch without asking.

If you want to use the FOR loop, check in help where it describes the /F "options" part. You have to be careful with the "delims=..." section to get it right.

and be especially careful using batch code that you... Read more

5 more replies
Answer Match 88.2%

Ok I'm totally at a loss on how to word this so I'm just going to write it out the best that I can...

First I have a batch file that I'm writing that will convert mp4 files to mp3 files (I have a lot) for a buddies band using ffmpeg.

Here's the code that I'm using:

ffmpeg -i folder\video.mp4 -f mp3 -ab 160000 -vn "\different folder\music.mp3"

what I would like to do is add to this so that I don't have to write out this code for every file I have... :/

I have the mp4 files in one folder and than the mp3 files are saving to another folder.

So here's an example of what the code will do if it isn't clear yet.

Folder 1:

video1.mp4
video2.mp4
video3.mp4

what it should do is grab video1.mp4 and convert it.

ffmpeg -i folder\video1.mp4 -f mp3 -ab 160000 -vn "\different folder\music1.mp3"

and than move onto the next one

ffmpeg -i folder\video2.mp4 -f mp3 -ab 160000 -vn "\different folder\music2.mp3"

and than the next one

ffmpeg -i folder\video3.mp4 -f mp3 -ab 160000 -vn "\different folder\music3.mp3"

It's going to have to grab the name from the mp4 file and insert it for the mp3 file.

I can get around pretty good in cmd if it's basic commands but when it comes to something like this I'm a little confused...

Thanks for the help in advance!
I'll see what i can do about searching some more on what I would have to do and if I find the solution I'll post it here if it isn't already answered.

A:Batch File that grabs file names from folder to insert into batch file

A DOS "for /f" loop should do the trick, although changing the filename extension for the output to do everything in one line escapes me at the moment.

Perhaps you could do a dir .\folder\*.mp4/s/b > mp4s.txt, then make a copy of that and edit each line to rename the file to the destination name, and save it as mp3s.txt. Then you just feed both the source (mp4s.txt) and destination (mp3s.txt) filesnames into the for /f loop which handles the ffmpeg conversion.

Quite a crude solution and you'd have to handpatch the destination filenames, but i can't think of how to get a source mp4 filename and then just change the extension.

3 more replies
Answer Match 87.36%

hi everyone...

i wrote a batch file to move several different file types from one folder to multiple folders...

when i run it, i get access denied on some of the files to be moved, but only the files that are trying to overwrite existing files.

i use the /-y option and when i get the prompt to overwrite, i type a for all or y for yes and i get an access denied error....

any ideas?

thanks..
 

A:Using The Move Command In A Batch File...

6 more replies
Answer Match 87.36%

Hello All,
I have a line of script that I want to have not only display the output to the console screen but also redirect to a file.

'if exist %SourceServer% XCOPY %SourceServer%\*.* "C:\Program Files\Foundation Systems\" /F /D /Y >> %MyLogFile%'

as you can see, I have it redirecting to a file just fine but I really want it to also display the action to the user running the file. In this instance I would like the end user to see how many files get copied over AND I want that info written to a log file for reference should I need to know who has run that batch file.

Seems easy enough but I cannot seem to get both to work simultaneously.

A:redirecting batch file command

This functionality is not native to the cmd shell. You would need a port of the TEE command that is in most Unix/Linux distributions for Windows. There are plenty of them. Just google search.

1 more replies
Answer Match 87.36%

Hi

i want to create a batch file that will change the users password on the local pc
i want it to change the current users password

i have already a file containing
net user %username% ???????

where the '?'s' are is where i would type the new password but i want it to ask the user fto type the new password in first
ie

run the file and it asks for the new password to be entered and then changes it to the new passowrd

thankyou
 

More replies
Answer Match 87.36%

I've set up a Virtual Router as in this page, but what it doesn't tell you is that you need to re-run the elevated command netsh wlan start hostednetwork every time the computer boots or comes out of standby.

Is there a way to run an elevated command via a batch file?

Later ... I've just found a similar tutorial here on W7F, and this mentions running batch files as administrator. However, I want to set this up for a novice user to use.

A:Elevated command via batch file?

I can think of one way---but I recommend disabling standby functionality on this machine. Since it will essentially be your wireless router, you're going to want it running most of the time.

1. Start > Run
2. type gpedit.msc
3. Under Computer Configuration, select Windows Settings.
4. Click on Scripts, and then Startup Scripts.
5. From here you can add your batch file, and it will run under the SYSTEM account when the computer boots up, and should be good to go.

Let us know how it works out!

9 more replies
Answer Match 86.52%

Hello,

I work as a tech support specialist and these days we are struggling with EDGE browser on how to reset it when it is full of pop-ups.

We know the standard method through Settings and figured out that if we open a new tab using ctrl+T we can then reset it but do we have a way to reset it using CMD or RUN. 

Any help is appreciated. 

More replies
Answer Match 86.52%

Hi I am having an issue with using the call command with a parameter in a batch file i am making to update some files for an application that is updated everymonth. I want the batch to call the second batch and use the same parameter that is placed on the original batch on the second batch. Please ANY help is well appreciated. I am banging my head on the wall with this one!. thanks.
Here is the batch:
del /f "logs\old-%1update.log"
rename "logs\%1update.log" "old-%1update.log"

echo Update APP Remotely Test Batch >> "logs\%1update.log"
echo _____________________________________________________________________________________________________ >> "logs\%1update.log"
Date /t >> "logs\%1update.log"
Time /t >> "logs\%1update.log"
echo ... >> "logs\%1update.log"

echo -=========================================%1 START!=======================================- >> "logs\%1update.log"
call "G:\Support\Batch Files\king.bat" %1
REG QUERY \\%1.king.lab\HKLM\SOFTWARE\Oneil\GEA /v "warning" >> "logs\%1update.log"
REG ADD \\%1.king.lab\HKLM\SOFTWARE\Oneil\GEA /v "Warning" /t REG_EXPAND_SZ /d "%%%%%%%" /f >> "logs\%1update.log"
REG ADD \\%1.king.lab\HKLM\SOFTWARE\Oneil\GEA /v "Demo" /t REG_EXPAND_SZ /d "%%%%%%%" /f >> "logs\%1update.log"
REG QUERY \\%1.king.lab\... Read more

A:Issue with Call command in batch file

did i put this question in the wrong topic?.
 

2 more replies
Answer Match 86.52%

I have a batch command to back up a subdirectory:
xcopy "C:\All\*" "E:\Allback\*" /E /Q

How can I hide the command window during the execution?

A:Batch file hide command window

Try this VBscript method (there's undoubtedly a PowerShell equivalent, too): How to run .BAT files invisibly, without displaying the Command Prompt window - The Winhelponline Blog.
--Ed--

0 more replies
Answer Match 86.52%

Hi Everybody.

I am attempting to execute a Command Line Interface for a scheduling software called JAMS, execute the relevant processes and then exit (see attatched code) all within a batch file.

I came up with the following but simply can't get the JAMS CLI to populate from SET SERVER ********4001 onwards. I know the rest of the script executes once I manually exit the JAMS CLI (inclusive of the SET SERVER ********4001) so I assume the JAMS CLI isn't being passed the remainder of the batch.

Does anyone know of a way to achieve this? I don't expect that a huge number of people will have used JAMS, but any information relating to similar issues would be greatly recieved.

Thank you for your help.
Code:


REM @ECHO OFF
SET OUTPUTLOCATION = [URL="file://*********/any/old/directory"]\\*********\any\old\directory[/URL]
SET /P JOB = "PLEASE ENTER THE PREFIX OF THE JOBS YOU WISH TO MIGRATE!!!
SET /P SETUP = PLEASE ENTER THE NAME OF THE SETUP YOU WISH TO MIGRATE!!!
"C:\PROGRAM FILES\MVPSI\JAMS\CLIENT\JAMS.EXE"
SET SERVER ********4001
EXPORT SETUP %SETUP% /OUTPUT="%OUTPUTLOCATION%\SETUP_%SETUP%.XML" /SYSTEM=BI_DEV
EXPORT JOB %JOB%* /OUTPUT="%OUTPUTLOCATION%\JOB_%SETUP%.XML" /SYSTEM=BI_DEV

SUBMIT MIGRATION /JOB
EXIT
 

A:Batch File - Passing To Another Command Line

12 more replies
Answer Match 86.52%

Hello I am new here. I have a major problem with the choice.exe command in vista . Here is my code ( only 1/12 done.) You guys can be the beta tester (if you want lol) i shortened the code
Code:

[B]:EXIT
exit
:login
cls
echo.
echo.
echo.
echo.
echo.
echo.
echo DOS OS 1.00
echo.
echo.
set /p %userlogin%=" Username : "
echo.
set /p %userpass%=" Password : "
echo.
echo Please Wait . . .
echo.
cd "C:\DOS_OS\USERS"
if not exist %userlogin% goto login_fail
cd "C:\DOS_OS\USERS\%userlogin%
if not exist %userpass% goto login_fail
goto login_sec_main

:login_first_run
cls
echo.
echo Welcome To DOS OS 1.00
echo 様様様様様様様様様様
echo.
echo This is your first time running DOS OS 1.00
echo This wizard will asist you in creating your
echo account.
echo.
echo To navigate forward press 6
echo To navigate back press 4
echo To select press 5
echo.
echo Next
echo.
choice.exe /c:6 /n
IF %ERRORLEVEL% 6 GOTO create_new_user[/B]

It exits out at

Code:

[B]choice.exe /c:6 /n
IF %ERRORLEVEL% 6 GOTO create_new_use[/B]r

PLS help me

 

A:Batch File - Choice Command - Vista

7 more replies
Answer Match 86.52%

Not sure if this would be the right forum to post this in... but I suppose it doesn't fit in any other forum anyways.

So I have a batch file I'm TRYING to write to do basically one thing:
Determine if a device is disabled.

I've gotten the command to give me a status output of the device, however, I can't seem to get the IF statement to work properly.

I figure I must set the output of the status thing to a variable, and then try and tell the thing to see if the word 'disabled' is in the variable string.
I've got this so far:

:TOP
FOR /F "tokens=*" %R IN ('devcon status ACPI\WACF009') DO SET VAR=%R
IF %VAR% == "*disabled*"
ECHO Device Disabled!!!
GOTO TOP

I'm apparently bad at this whole batch file writing thing, and I keep making mistakes, so I thought I'd see if anyone here knows anything.
In case you're wondering... No, I'm not trying to be redundant. In the end, the batch file is actually going to toggle the state of my notebook's WACOM sensor... the ECHO will eventually be replaced by the command to re-enable the touch sensor.
 

More replies
Answer Match 86.52%

Does anyone have a simple batch already made to copy? I need to copy everything from my Y:\ drive to my G:\drive. I need it to overwrite original files.. please.. if anyone has it... thanks.
 

A:Copy Batch file

This may work:

xcopy y:\*.* g:\ /a /e /k

Reference:
http://www.computerhope.com/xcopyhlp.htm
 

2 more replies
Answer Match 86.52%

I am trying to copy files from a source directory to an output directory when the output directory already has a file with the following:
../reusable_components/<filename>#.

I already have the following:
findstr /s /i /m "\<../reusable_components\>" *.xml > results.txt
This will return a list of filenames with the text in it.

Now I want to parse the list of files and take out the filename after ../reusable_components. I tried:
for /f %%a in ('findstr /s /i /m "\<../reusable_components\>" *.xml') do (echo %%a)
but that didn't work any ideas?

More replies
Answer Match 86.1%

Hello all , i am new to batch programming.

I wish to have a batch file to read .apk file from folder and then copy it to another folder. Then it should rename the copied apk file to test.apk

eg:
i have a file in folder e:\apps\angrybirds.apk , I want to copy this angrybirds.apk to d:\apps and rename it to test.apk

Here the file names in the e:\apps\ will be changing. So what ever may be the name , it should read the name of the file from e:\apps\ folder , copy it to d:\apps\ and rename it to "test.apk" . Test.apk is a fixed rename
 

A:Solved: Batch file to copy a file from folder and rename it in another folder

12 more replies
Answer Match 85.68%

Whats a command to put in a batch file that when exit is pressed it either wont do anything or it will minimze itself it would be something like

@echo off
if exit /m
then i dont know what else or if thats wrong please another solution!!

Thank you!!

A:Whats a command to put in a batch file that when exit is pressed it..................

i want a command line that i can use in a batch file that if the big red X at the top right of the screen is pressed it does not do anything or it minimises itself!

5 more replies
Answer Match 85.68%

Hiya, i wasn't really sure where to put this, and i have Googled it but i can't find a reason why my batch file no longer does what it used to do. According to everything i've read, my batch should stop at IE, until i close IE, whereupon it should continue. This is how it used to behave.

Here it is:

Code:
taskkill /im skydrive.exe
start "BF3 Borderless" /d "C:\PortableApps\BF3Borderless-1.2" "BF3 Borderless.exe"
"C:\Program Files (x86)\Internet Explorer\iexplore.exe"
taskkill /im "BF3 Borderless.exe"
taskkill /im Origin.exe
start "SkyDrive" /d "C:\Users\Recusant\AppData\Local\Microsoft\SkyDrive" "SkyDrive.exe"
It's supposed to unload SkyDrive which chews up my bandwidth when in use, load a little proggie that switches my viewing mode for BF3, then run IE... AND STOP! Problem is, it simply doesn't stop there - it used to! Then it's supposed to move on when i close IE and put my system "back to normal".

I had changed it recently to put SkyDrive in there, but when i retrieved a backup that i KNOW worked, it too just kept going through the batch after IE had run (without me closing it).

I have no idea what has caused my batch to do this.

Help! (please)

A:Batch file not waiting for command to finish before moving on

Have you updated to IE10?

If so, then this line:
"C:\Program Files (x86)\Internet Explorer\iexplore.exe"
Is launching the 32bit version of IE10*...
...which then launches the 64bit version of IE10*
...then the 32bit version of IE10 exits ram & the batch file continues.

*you never see these windows

IE uses the first instance of iexplore to manage the other instances. This allows for crash recovery and other things. Starting with IE10, that manager instance will be 64bit on a 64bit OS. The tabs or child processes will be 32bit instances of IE by default. You should turn on 64bit tabs. A 32bit instance will be launched if a plugin is needed that only has the 32bit version installed.

Edit: more than you every wanted to know about stuff like this:
http://blogs.msdn.com/b/ieinternals/...o-desktop.aspx

2 more replies
Answer Match 85.68%

hello, I was wondering just a few seconds why the subject Batch file to delete folder had been closed? the problem hasn't been solved?

So I was also wondering how to delete subfolders in batch command line or file?

A:[SOLVED] Batch file or command to delete folder

Oh! how stupid am I.

few minutes in google and the answer is :
for example you are dealing with the C:\temp folder and you want to erase all elements in it!
batch file :
@echo off

del "C:\temp\*" /Q /F /S
for /d %%X in ("C:\temp\*") do RMDIR /S /Q %%X

exit

command line for delete subfolders (if you want to test) :
for /d %X in ("C:\temp\*") do RMDIR /S /Q %X

I think it's larger better than erase the "C:\temp" folder and recreate it! Because if you want to do this for all the temporary folders (windows has it tricks)... it will be long. fortunately, you wouldn't do that because I made it for you, enjoy (just replace %profile% by you'r profile name or the profile name variable (%USERNAME%)):
@echo off
del "C:\Documents and Settings\%profile%\Local Settings\Temp\*" /Q /F /S
for /d %%X in ("C:\Documents and Settings\%profile%\Local Settings\Temp\*") do RMDIR /S /Q %%X

del "C:\Documents and Settings\%profile%\Local Settings\Temporary Internet Files\Content.IE5\*" /Q /F /S
for /d %%X in ("C:\Documents and Settings\%profile%\Local Settings\Temporary Internet Files\Content.IE5\*") do RMDIR /S /Q %%X

del "C:\Documents and Settings\%profile%\Local Settings\Application Data\Temp\*" /Q /F /S
for /d %%X in ("C:\Documents and Settings\%profile%\Local Settings\Application Data\Temp\*") do RMDIR /S /Q %%X

del "C:\temp\*" /Q /F /S
for /d %%X in ("C:\temp\*") do RM... Read more

2 more replies
Answer Match 85.68%

Hi,

I've got a strange problem with Vista Biz. Most batch files work fine, but any one involving the shutdown command are spinning their wheels by repeating the command endlessly:

shutdown /s

shutdown /s

shutdown /s

shutdown /s(There is a blank line between echos.)

The machine has no problem shutting down, just not by batch file. The same holds true for other switches than /s, such as /a and /r. I've had a /t 10 at the end of the command line, and it doesn't help.

When I called up the shutdown GUI (/i), the Ok button was grayed out, because no computer was selected. When I clicked Browse, I got an Active Directory ~not available~, or some such. I'm on a workgroup, not a domain (though the machine used to be on a domain), so I don't see how this matters.

This used to work. Then I used FileTypesMan to change the edit verb for batch files from notepad to metapad. Somehow that broke it. Switching back didn't help. So I downloaded the Vista batfile reg fix, and merged it. That fixed it.

But that was last week. The problem returned today with nothing having been changed. And the reg fix does nothing now.

Very puzzling.

Be well,
Paul

A:Shutdown batch file: endless command repetitions

Hello Paul and welcome to the forums

That is odd!

Let's see if we can find any problems

SFC Scan

1. Open the start menu
2. In the search box, type cmd
3. Right click on cmd and select Run as administrator
4. In command prompt, type:

sfc /scannow

5. Let it run and let me know if it finds any Integrity Violations

Repeat that process with the following command:


Code:
sfc /scanfile=%SYSTEMROOT%\System32\shutdown.exe
Tom

21 more replies
Answer Match 85.68%

Hi,
I'm trying to write a batch file to do some basic file copy/folder management tasks.

What I want to do is create a directory with the current date in the format yy-mm-dd.

Since I have php installed, I can run

Code:
php -r echo(date('y-m-d'));
But I want to use the output of this as the parameter of mkdir. Is there any way of doing this?

Thanks.
 

A:Solved: Batch file command output redirection

I Don't Know PHP . But Here Is How to Make A Folder With Todays Date

MD %DATE:~4,2%-%DATE:~7,2%-%DATE:~10,4%

%DATE% - expands to current date using same format as DATE command.

%var_:~Start,Count% where the Start commences at 0
 

2 more replies
Answer Match 85.68%

Hi all,

I would like to simultaneously launch multiple instances of a single CMD command. How do I write a batch file to do so?

Regards,
Nicholas.

A:[SOLVED] Batch file: multiple instances of a CMD command.

Quote:





Originally Posted by billybong001


Hi all,

I would like to simultaneously launch multiple instances of a single CMD command. How do I write a batch file to do so?

Regards,
Nicholas.





Hi Nicholas -

For info, you can type cmd /? for details on the switches available with cmd.

To answer your question, try cmd /k - that will execute the command and then keep running.

Regards. . .

jcgriff2

.

14 more replies
Answer Match 85.68%

I'm not a script expert but I'm trying to right something simple (or so I believe).

I want to run a command in a batch file: systeminfo

This command returns a lot of information.

I want to be able to extract two lines and place their content into variables, more specifically, "Host Name" and "System Up Time". Than I would write them to a file (as if it was a log). I already got something similar doing the following:

systeminfo | find /i "Host Name" >> text.txt
systeminfo | find /i "System Up Time" >> text.txt


The problem is that this only creates a string that I can't treat. I would like the "System Up Time" to be broken into hours, minutes and seconds (or translated into seconds) because I want to add a statement that if the "system up time" is less than 10 minutes, then do something.

Is this possible?
Is there any other command that I can use?
Any help is appreciated.

More replies
Answer Match 85.68%

Well, I was bored today and so decided to muck about with the command prompt, seeing what it could do. After reading a (good) basic tutorial from here on it, I reckoned it could save me a few seconds at boot up, and make me feel nice and nerdy (:D). So, I created the following batch file, to run the programs I use when I start up:cd My Documents
stefen1.odt
cd C:\Program Files\Windows Media Player
wmplayer.exe
cd C:\Program Files\Mozilla Firefox
firefox.exe
cd C:\Program Files\MSN Messenger
msnmsgr.exe
cd C:\Program Files\Mozilla Thunderbird
thunderbird.exe
exitNow, that should work fine, and it seems to work - it runs all of it until "thunderbird.exe". Now, as far as I can see, it runs the thunderbird line (as the program appears), however, it will NOT run the exit line UNTIL I close thunderbird... I tried switching up the order and it definetely seems to be a problem with thunderbird - anything after launching thunderbird will not run until thunderbird has been closed... Why?Help?

A:Command Prompt Batch File Not Fully Running

I suspect command line parameters to start and exit are needed. I just checked google, so this might get you startedhttp://kb.mozillazine.org/Command_line_arg...s_(Thunderbird)Hey, have fun learning the stuff. So every one of those started and exited properly before going to the next or was it all asynchronous and you watched'm all at one time? Just curious.

4 more replies
Answer Match 85.68%

reg add HTLM\Software\Microsoft\Windows\CurrentVersion\Policies\System /v DontDisplayLastUserName /t REG_DWORD 00000001 /f

I am trying to hide all users at logon and I know this is where you change it but for some odd reason the syntax is wrong and I can not figure it out. Can someone please help me fix this?

A:Problem with batch file command to edit registry

I figured it out all. My problem lied in a few small argument issues and missed quotation marks. For future references this is the correct syntax.

reg add "HTLM\Software\Microsoft\Windows\CurrentVersion\Policies\System" /v "DontDisplayLastUserName" /t REG_DWORD /d 1 /f

1 more replies
Answer Match 85.68%

Fellow Forum Members,
I have two external hard drives I'm calling Hard Drive A and Hard Drive B. Hard Drive A & B are mounted to external USB cradles. Both USB cradles are connected to the same PC containing Hard Drive C. My objective is to transfer all data files, folders, sub folders from both Hard Drive A & B over to two different hard drives on Hard Drive C.

I need help figuring out Windows 7 so I can accomplish the task above. I have heard of RoboCopy but don't know how to write the script. Does an application such as XYExplorer perform the task of batch copying from multiple external hard drives over to two different folders in an internal hard drive?

How would a RobyCopy Script look like that does the following:

Copy G:\hdA_data1 over to C:\data1_from_hdA
Copy H:\hdB_data2 over to C:\data2_from_hdB
Automatically Turn off computer after copy operation is done


Any info will be greatly appreciated. Thanks in advance.

A:Windows7 Batch File Copy Possible?

Hi,

I haven't had much luck with working out how to turn the computer off automatically, although it can be done.

For the copy process, just usex copy, robocopy gives no benefit since this is a one time? copy of files.


Code:
xcopy G:\*.* /E C:\DataG
xcopy H:\*.* /E C:\DataH
From the cmd prompt:

Code:
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\Colin>xcopy /?
Copies files and directory trees.

XCOPY source [destination] [/A | /M] [/D[:date]] [/P] [/S [/E]] [/V] [/W]
[/C] [/I] [/Q] [/F] [/L] [/G] [/H] [/R] [/T] [/U]
[/K] [/N] [/O] [/X] [/Y] [/-Y] [/Z] [/B]
[/EXCLUDE:file1[+file2][+file3]...]

source Specifies the file(s) to copy.
destination Specifies the location and/or name of new files.
/A Copies only files with the archive attribute set,
doesn't change the attribute.
/M Copies only files with the archive attribute set,
turns off the archive attribute.
/D:m-d-y Copies files changed on or after the specified date.
If no date is given, copies only those files whose
source time is newer than the destination time.
/EXCLUDE:file1[+file2][+file3]...
Specifies a list of files containing strings. Each string
should be in a separate line in the files. When any of the
strings ... Read more

2 more replies
Answer Match 85.68%

I know there are solutions for this on this forum but I can't get any of them to work in my specific situation.

I have a program that cannot deal with ZIP files and I need to manually sort them out. What I can do is export a partial location for these ZIP files to a txt files so I have:

filelist.txt:
folder\file.zip
folder\file2.zip
...
filder\fileN.zip

What I want to be able to do is create a batch file that will read the location of these files and copy them to a folder. The files are located on a network share but they r are mapped in My Computer. I can modify to the txt file so it gives the full path as a UNC path or a hard path.

I've been trying to get it to work using a For In Do statement but I don't know if that's the best solution. Help would be greatly appreciated. Thanks.

Dilo.
 

A:Batch file to copy files

If you need to replicate the folder structure you need to use xcopy or robocopy.
Posted via Mobile Device
 

2 more replies
Answer Match 85.68%

How do I copy/xcopy a file to the desktop using a batch file? That is, what is the destination to use?Thanks a bunch, Uncle Dewey

A:How do I copy to desktop using a batch file?

%UserProfile%\DesktopOr C:\Users\Public\DesktopOr C:\Users\(username)\DesktopFor Vista

5 more replies
Answer Match 85.68%

Is there a simple way to copy an entire folder and its subfolders to another location using a batch file?

Thanks,
Harold
 

A:Batch file to copy subfolders?

8 more replies
Answer Match 84.84%

What a batch file command to change the desktop picture to black? I know it would involve the registry probally so could someone write out exactly what code that would make the happen please!!!!

More replies
Answer Match 84.84%

First and foremost, before I am told to go download this program or that program or what have you, please note the use:

I am creating a test fax program. I have it set so my users (some who still think computers come with a built-in cupholder) are able to run this fax.bat program I made, where it asks for the number, and then runs this command:
Code:
START mailto:fax="%fax%"[email protected]?subject=Text%%20Fax^&body=Residential%%20Repair:%%20/%%20Business%%20Repair:%%
The %fax% is the variable, and this sendto will open an email that the user can send without typing or doing anything else. My issue is that to make it work best, I would like to have it attach a text file that I would have created.

My search on the net all points to programs that run a CMD prompt. This will not work, as I cannot install a server or files on all the the computers that someone might use.

We run 32bit WinXP Professional Version 2002 SP3 (please don't think less of me ) with Outlook 2007. I honestly think it is a lost cause and cannot be done. The best I could do was come up with a list of command-line switches at:

http://office.microsoft.com/client/...ryid=ab041fa6-42b5-4b31-9ee5-e8370f00207a#BM4

However nothing jumps out to send a file with all the info. The best I could do was "outlook.exe /a testfile.txt" which will load the file as an attachment, however the to address and subject are blank. At at this point, I can do one, or the other. Is there a out... Read more

More replies
Answer Match 84.84%

I am running Hyper-V on Windows 10.

I am using the PC for media playback / gaming in big screen and rarely see the desktop. I have an service running and APP on my phone, so i can start batch files and programs without the need for a KB/M.

I have just setup a VM, but i dont want it running all the time, i just want to use it to do some video rendering or whatever when i need it to, i especially don't want it to be running when playing games.

so is there a way i could write a batch file or VBS to start the VM (not connect) then i could connect to VM via remote desktop on my laptop (or other machine)

and another batch file to turn it off, when i want to do some gaming?

i have googled for about an hour but came up empty

More replies
Answer Match 84.84%

Hi Everybody

This is my first post on this forum.

I am trying to create a batch file which prompts for an user input. Depending upon what the user response is, I want to terminate a particular application.

When I use the "Taskkill" command at the "Command Prompt", it works and terminates the desired application. However, when I use it in the batch file, the application doesnt' terminate.

Any suggestions, how can I get it to work from within a batch file? I am using Windows XP Professional SP3.

The batch file is reproduced here for your immediate reference :-
Code:

@echo on
set /p Input =
if /i "%Input%"=="y" goto DoNotProceed
exit /b

:DoNotProceed
taskkill /im notepad.exe


This batch file is actually the batch file that is run as a "Before Backup" task using GFI backup program. I am testing the above batch trying to terminate Notepad application but the intent is to termiate this GFI application. I know the image name for this application.

The "Taskkill" command as it is works from any location. The active directory does not have to be "Windows\System32" which houses the "Taskkill" exe file.

This batch file runs but doesn't terminate the "Notepad" application.
An early response shall be highly valued.

Best regards

Deepak Agarwal
 

A:Taskkill does not work in batch file but works at command prompt

6 more replies
Answer Match 84.84%

I'm trying to launch an Access 97 database with a link table from a dos batch file that is executed by the AT command. My environment is an NT Server w/SQL on top. I'm trying to automate a export/import process using Access to filter and save the data into a text file to be imported into another application. The problem is when the batch file is run from the AT command I get a login prompt for the link table. When I run the batch file alone it doesn't do that. A login/password isn't necessary to open the database either. I don't know if I need a switch when opening Access or a switch for the AT command or if I need to recreate the ODBC drivers with a login or password. I need to know where to go from here.
My AT command is
AT 14:00 /interactive "c:\juris.bat"
My Juris batch file is
@echo on
cd\
cd program files
MSACCESS "c:\access\juris.mdb"
I would appreciate ANY info, thanks.
 

A:Receiving login prompt when running batch file from the AT command.

This could be so many things but first I would check the file permissions on the server it sounds like your login does not give you full acces or because your running from dos you have not logged on the server
 

1 more replies
Answer Match 84.84%

Ok, I've got an extremely old version of DOS that needs to launch a batch file that requires cmd.exe .

For this reason there are two things I can't do. I cannot simply launch the batch file by entering in the path\filename and i can't use "start Path\filename" because start is a relatively new addition to the DOS.


So what I'm looking for is something I can type into an OLD version of dos that will call up the CURRENT CMD command prompt, execute the batch file, and then close.


So far... I'm lost.
 

A:Alternative ways to launch a batch file from the command prompt?

How about double clicking or drag and drop?
 

4 more replies
Answer Match 84.42%

Hi
I am currently running the following to supposedely create a directory IE V:\Backup Folder\Pictures\Backup 21-05-2012
robocopy /e "c:\users\jon\pictures" "v:\Backup Folder\Pictures\Backup %date:~-10,2%-%date:~-7,2%-%date:~-4,4%"

Evrything works fine except the backed up pictures folder is just named as V:\Backup Folder\Pictures\My Pictures

If for arguments sake I backup my outlook file using the above parameters I get what I want EG
V:\Backup Folder\Outlook\Backup 21-05-2012

It's as though there is something within the pictures folder? that is preventing the corrctly named folder from beign created?
The same happens when I try and backup Desktop and Documents folders
What am I missing?

A:Creating Batch File with Robo Copy

  
Quote: Originally Posted by Big Tung


Evrything works fine except the backed up pictures folder is just named as V:\Backup Folder\Pictures\My Pictures


Hi,

I can't quite understand where the \My Pictures is coming from. Do you mind posting a screen capture image of the folder arrangement, so I can see what it looks like?

regards,
Golden

3 more replies
Answer Match 84.42%

I have a folder on a network drive that I would like to copy to another location on another network drive. The source folder should copy over the destination folder, part of the path to the destination folder to be copied over changes based on the person who signs into the PC; OS is XP. This is what I thought would work but hasn?t. Any help would be much appreciated.

XCOPY ?\\Server Name\ Folder1\Folder to be copied? ?\\Server Name\%userprofile%\Folder\my documents\Same Folder Name As in The source folder to be copied over" /E /C /R /I /K /Y

A:Copy Folder batch File Issue

XCOPY ?\\Server Name\Folder1\SourceFolder? ?\\Server Name\%username%\Folder\my documents\DestinationFolder" /E /C /R /I /K /Y

Hope this helps

1 more replies
Answer Match 84.42%

Lately I've noticed a lot of new Windows users don't really know how powerful command line tools Windows 7 includes.

Here's one, making batch file copy easy and almost automated: Robocopy. To use it, just open the command prompt and type robocopy /? to get all the options. Here's the summary in case you are interested:

-------------------------------------------------------------------------------
ROBOCOPY :: Robust File Copy for Windows
-------------------------------------------------------------------------------

Usage :: ROBOCOPY source destination [file [file]...] [options]

source :: Source Directory (drive:\path or \\server\share\path).
destination :: Destination Dir (drive:\path or \\server\share\path).
file :: File(s) to copy (names/wildcards: default is "*.*").

::
:: Copy options :
::
/S :: copy Subdirectories, but not empty ones.
/E :: copy subdirectories, including Empty ones.
/LEV:n :: only copy the top n LEVels of the source directory tree.

/Z :: copy files in restartable mode.
/B :: copy files in Backup mode.
/ZB :: use restartable mode; if access denied use Backup mode.
/EFSRAW :: copy all encrypted files in EFS RAW mode.

/COPY:copyflag[s] :: what to COPY for files (default is /COPY:DAT).
(copyflags : D=Data, A=Attribut... Read more

A:Batch file copy made easy

I've been using robocopy for years. It does pretty much all of my backups at home and my laptop backup at work. Most things backup to an external hard drive (or a couple as I like to keep one offsite)

C:\Windows\system32\robocopy C:\users\user1\Documents E:\Backups\PC-name\Documents /MIR /E

That commands mirrors up the source and destination and gets empty folders thus preserving the directory structure.

Robocopy only copies files that have changed...thus subsequent copies are extremely fast.

I highly recommend it.

3 more replies
Answer Match 84.42%

Hello Everyone its me again, I need help on this new file I was making to Add and Delete Mods for Garrys Mod by the few clicks of some buttons.
But I've ran into a problem.

(Im not going to give the whole code because its way to long I'll give shortened version of it.)

Heres what I had before:

IF Not exist "C:\Program Files\Steam\steamapps\psycozl\garrysmod\garrysmod\lua\effects\stridcan_charge\init.lua" copy "C:\Users\~\Desktop\Ultimate Gmod Folder\Mods\shoop_da_whoop\Shoop da Whoop\lua\effects\stridcan_charge\init.lua" "C:\Program Files\Steam\steamapps\psycozl\garrysmod\garrysmod\lua\effects\stridcan_charge\"
IF Not exist "C:\Program Files\Steam\steamapps\psycozl\garrysmod\garrysmod\lua\effects\stridcan_expld\init.lua" copy "C:\Users\~\Desktop\Ultimate Gmod Folder\Mods\shoop_da_whoop\Shoop da Whoop\lua\effects\stridcan_expld\init.lua" "C:\Program Files\Steam\steamapps\psycozl\garrysmod\garrysmod\lua\effects\stridcan_expld\"
IF Not exist "C:\Program Files\Steam\steamapps\psycozl\garrysmod\garrysmod\lua\effects\stridcan_fire\init.lua" copy "C:\Users\~\Desktop\Ultimate Gmod Folder\Mods\shoop_da_whoop\Shoop da Whoop\lua\effects\stridcan_fire\init.lua" "C:\Program Files\Steam\steamapps\psycozl\garrysmod\garrysmod\lua\effects\stridcan_fire\"
IF Not exist "C:\Program Files\Steam\steamapps\psycozl\garrysmod\garrysmod\lua\effects\stridcan_mzzlflash\init.lua" copy... Read more

A:Solved: Gmod Batch File Copy Help???

11 more replies
Answer Match 84.42%

Below is a batch file I created to copy all the files from a program called A5V5. This batch file works to copy the files to two different drives What I want to do is if the J: Directory is not availble (This is a flash drive) that it will copy to the E:\ directory which is a second HDD and not leave a "The system cannot find the drive specified" when the flash drive is not inserted.

@echo off
cd c:\
cd program files (x86)
cd A5V5
cd Ranch Mobile, Inc
Copy *.* "E:\Ranch Mobile" (This is a second hard drive for backup files only)
Copy *.* "J:\Ranch Mobile" (This is a Flash drive that is not always inserted)
Pause

Thanks for any help. I like the way batch files work and I can do these simple ones but when it comes to doing the more complicated ones I am at a total loss.

A:How to make a multible copy batch file

Hi AGB,

Welcome to Seven Forums.

Can you try the following and see if this works:

Code:
@echo off
cd "c:\program files (x86)\A5V5\Ranch Mobile, Inc"

Copy *.* "E:\Ranch Mobile"

IF EXIST J:\ (goto jdrive) ELSE (goto end)

:jdrive
Copy *.* "J:\Ranch Mobile"

:end
Pause
This will always copy to your fixed E:\ drive and will only copy to your J:\ drive when exists.
Is this what you wanted?

Regards,
JDobbsy1987

3 more replies
Answer Match 84.42%

I'm trying to create a batch file that will copy from a source and paste into a destination. I need it to add the date and time to the file name as well.

So far, I have it successfully adding the date with the following code:

ren <file> <file>%date:~4,2%-%date:~7,2%-date:~10%.doc

This works....but I cannot seem to add the time as well.
Any help?

 

A:Simple Copy and Paste Batch File

See if this thread helps?

Or, just copy the files and use a utility like Rename to do the file name changes after the fact.
 

1 more replies
Answer Match 84.42%

Hi all,

To increase our backup solutions, we have decided to backup our SQL database every hour to a folder within the C drive (we couldn't get it to backup straight to a USB drive). So now we need a way (batch file best solution?) to copy these files to the USB drive, lets say every 1.05hours just after they've been created?

Maybe we could copy the entire folder every hour and delete old backups that are in this folder and to the new place for the backups. (although I guess it won't work as it'll have the same folder name once it has been copied).

Or copy the individual files to that new folder although with this they have all different names so is it possible to copy the newest file to the new folder and then after this delete the old backups from a certain time frame?

Big thanks for your help!

A:Batch file to copy files from C drive to USB

Code:
REM Creates a Backup of files every hour
@echo off
:start
XCOPY <source path> <destination path> /w /f /-y
TIMEOUT /t 3600 /nobreak
goto start
This might work, I'm no expert by any means, but the batch file should copy all the files, and then pause for a hour, and then loop back to the start and complete the same process again.

Here's what the XCOPY switches mean - http://www.microsoft.com/resources/d....mspx?mfr=true

9 more replies
Answer Match 83.58%

Good evening, All -I'm new to this forum, but I love the information/assistance provided.  I've 'lurked' before - gleaning information - but I never had to post because I always found the solution.  Now, I'm stumped on something, and thought you all might be able to assist me.I have a very simple batch file that copies the contents of a txt file onto the clipboard.  Trust me, this is a simple file...the command is:C:\Windows\System32\cmd.exe /k clip < c:\transfers\test.txtc:\exittest.txt contains the information that I want pasted to the clipboard (e.g. my email address).Next, I've assigned a hotkey to the shortcut that runs that batch file.  So, for example, CTRL+ALT+O would copy the text in test.txt onto the clipboard.  I can then use CTRL+V to paste that pretty much anywhere.So far, so good.Now, let's say that I'm on a webpage, and it asks for my email address.  Rather than typing it, I press CTRL+ALT+O to place it on the clipboard.  Here's where I hit my issue.  When the batch file runs, I lose the focus on the field that I wanted to fill in on the webform (or whatever program), so I have to click back to the field and THEN paste.Here is my question...is there a way that I can adjust the batch file so that it will "hold" or "return to" the field where I hit the hotkey combination, so that all I need to do is hit CTRL+V (or, better yet, where it would "know"... Read more

A:How to change the focus back to original window via a Batch File Command

Your objective is not clear.There are some  here that can do anything with a batch file, - except make good coffee.  But seriously, for sometime Microsoft has recommended  people to lo use some kind of Windows Script Host pt for tasks that involve the windows graphical  interface. Batch commands are butter used for things that stay at the condom line.

14 more replies
Answer Match 83.58%

does anyone know how to make a batch file where you could start ,disable , stop and manual for a service from the command prompt ?

for example instead of going to services.msc and right clicking on a service then clicking on properties then making the startup to be manual,automatic or disable . I could do with a batch file where i would just launch the batch file and it would make the startup to manual and then disable the service that i want to disable.

A:How to make a batch file on starting and stopping services from command prompt ?

Aside from the obvious, what is it you're trying to accomplish? What services do you want disabled at one time but not another?

15 more replies
Answer Match 83.58%

Hi,
I have a few questions about my simple batch to copy a Outlook pst file to an external drive. First, robocopy doesn't copy my file; Second, is there a way to prevent the taskeng.exe window from appearing; and Finally, I tried the command "copy" instead and it copies the file but the taskeng.exe window "hangs" and does not continue to restart outlook and therefore close on its own. By the way, the pst file is over 4Gb. Any help is appreciated, thank you!

:: Backup pst file to Server external drive
@echo off
setlocal EnableDelayedExpansion
start "" "C:\Program Files (x86)\Microsoft Office\Office12\Outlook.exe"
taskkill /im outlook.exe /f
@ping 192.168.1.1 -n 5 -w 1000>nul
@ping 192.168.1.1 -n 5 -w 1000>nul
robocopy "C:\Users.pst" "\\SERVER\Outlook Backup\user.pst"
start outlook.exe
cls
@exit
 

A:Batch to copy Outlook pst file to external drive

6 more replies
Answer Match 83.58%

I'm running vista on my computer and would like to be able to copy all log files containing the keyword "error" to a folder called "error logs"
thanks in advance
 

A:How to make a batch file to copy files containing a certain keyword

Welcome to the forum.

use the 'good old msdos' command find

Open command promt en type find /? this will help you see the syntax
 

1 more replies
Answer Match 83.58%

Hi all,

I need a batch file (code) to copy files from last month and zip it for archive. Can somebody help me please?

Thanks!
Samsunlu
 

A:batch file to copy files from last month to archive it.

8 more replies
Answer Match 83.58%

I have a usb that I copy files from to new computers. I do this all day and would like to make it quicker.
I will have an XP path and a Vista/7 path, but just worried about XP right now.
The problem is I don't know what drive letter the USB will be in. I thought there was a %thisdrive% switch of some time.

In addition it has spaces and I don't know how to replace spaces in the path. Here is an example;

copy f:\install\105 wallpaper\*.* c:\documents and settings\All users\Shared Docuemnts\Shared Pictures\

Summary;
Determine the USB drive letter?
bridge space issue?
 

A:batch file to copy from usb- unknown drive letter

8 more replies
Answer Match 83.58%

I want to write a batch file that do this for me:

- makes a directory with the "yy.mm.dd.hh.mm" as the directory name,
- copies files and folders from a TEST directory to above destination,
- copies only new (or modified) files from the TEST directory to a separate folder.

Any Idea?

A:a simple batch file for copy files and folders

To create a directory with the date and time as the name, In a batch file use:

set DirName=%date:~-4,4%.%date:~-7,2%.%date:~0,2%.%time:~0,2%.%time:~3,2%
MD \%DirName%

Then in the same batch file use robocopy to copy files to the new directory

robocopy TEST %DirName% /e

you need to add your own paths and read the robocopy help for the right switches you need.
By default Robocopy copies only files that don't exist in the target directory but because you are creating a new directory every time it will copy every thing in TEST

You could use the /A switch which only copies files with the Archive attribute set.

3 more replies
Answer Match 83.58%

I am trying to write a batch file that will copy my backup files to another drive. For example I currently have the file backed up to C:\Backup\movie backup
I want to be able to copy it to an external HDD: -
X:\Backup Folder\Movie Library, however each time I do this it overwrites the previous backup file.
I want to be able to copy this backup to a new folder each and every time, as follows: -
Todays backup file would copy to:-
X:\Backup Folder\Movie Library\backup 03-Jul-2010 .......tomorrows would go to
X:\Backup Folder\Movie Library\backup 04-Jul-2010 etc
Can anyone help. I have been looking all day and can't find anything.

Thanx in advance

Jon
 

A:Batch File to copy to Date Stamped Folder

Welcome to TSG!

Use "X:\Backup Folder\Movie Library\backup%date%" as the destination folder name in your batch file. The %date% variable will be expanded with today's date
 

2 more replies
Answer Match 83.58%

I need help with a batch file to copy the contents of my source dir to the destination dir that is to be created with that days date using xcopy or robocopy. Any help is appreciated!

A:Need a Batch File to Copy to a Custom Dest Folder

This should get you started...

for /F "tokens=1-4 delims=/- " %%A in ('date/T') do set DATE=%%A-%%B-%%C
md c:\tmp\%DATE%
xcopy c:\output c:\tmp\%DATE% /s

4 more replies
Answer Match 82.74%

I have a list of 1000 files names that I put in a text file named list.txt. Need to find them in more folders, sub folders which has 12000+ files in it. The below script works fine but I would like the Admin Right to be removed and also I want the files to be moved permanently into C:\your_files. Is there any one who could help me in this? Thank you in advance.

@echo off
REM (c) 2013 BY NEUTRON16 (http://www.sevenforums.com/member.php?u=3585)
CLS
TITLE Mass file finder by Neutron16
REM finds files in list.txt file and copies them to C:\your_files
REM CHECK FOR ADMIN RIGHTS
COPY /b/y NUL %WINDIR%\06CF2EB6-94E6-4a60-91D8-AB945AE8CF38 >NUL 2>&1
IF ERRORLEVEL 1 GOTO:NONADMIN
DEL %WINDIR%\06CF2EB6-94E6-4a60-91D8-AB945AE8CF38 >NUL 2>&1
:ADMIN
REM GOT ADMIN RIGHTS
COLOR 1F
ECHO Hi, %USERNAME%!
ECHO Please wait...
FOR /R "%~dp0" %%I IN (.) DO for /f "usebackq delims=" %%a in ("%~dp0list.txt") do echo d |xcopy "%%I\%%a" "C:\your_files" /e /i
COLOR 2F
ECHO.
ECHO (c) 2013 by Neutron16 (http://www.sevenforums.com/member.php?u=3585)
PAUSE
GOTO:EOF
:NONADMIN
REM NO ADMIN RIGHTS
COLOR 4F
ECHO.
ECHO PLEASE RUN AS ADMINISTRATOR
ECHO.
pause
GOTO:EOF

More replies
Answer Match 82.74%

I require a batch file or free utility that i can redistribute from my web site to other users, (gamers) that will copy the contents of a directory inside their game to a new location and re-name the directory at the same time. Something like this;

Copy "Genesis\Vehicles\truck\diesel\4tonbaker" to "Genesis\Vehicles\truck\diesel\4tonbutcher"

The batch file needs to be run without the need for a command line box being opened, that is, if the user can double click on it or run it with a 'right click' that would be great. Problem there is, I maybe need an exe file not a batch file. The other part of the problem is that the folder to be copied may or may not be in the same location on every PC that runs the file. It may be the case that the 4tonbaker folder is on;
C:\Genesis\Vehicles\truck\diesel\4tonbaker or
D:Genesis\Vehicles\truck\diesel\4tonbaker or even
E:\Games\mystuff\Genesis\Vehicles\truck\diesel\4tonbaker

and I require the end user to have no need to know, just for the directory to be copied and renamed when and where it is found.

If possible I then want the batch file to perform a second task. I want to distribute a folder, lets say it is 4tonbutcher and in that folder there are files lets say doc1.txt, doc2.txt and doc3.txt

On any given users PC 4tonbaker has these same named files but the content is different to the ones in my folder 4tonbutcher, I want to update the newly created folder, 4tonbutcher with the new txt files I d... Read more

A:Batch file or Exe to copy & rename directory and update files

Sounds like you need a windows shell program, I'm not expert enough to help you with this

Here's a nice tutorial:

Win32 Shell Scripting Tutorial

Off topic: this is trivial to do in UNIX, I can whip up a shell script for that in no time...

1 more replies
Answer Match 81.06%

I am a complete newbie when it comes to batch files and batch file software, so apologies in advance.

I've done some research on Google etc but I seem to just be getting more and more confused trying to use various different scripts and programs and reading different info on various websites.

This is what I need...

I have a folder with around 2000 files in it. I want to be able to copy certain files from this folder (normally around 40) and place them in a brand new folder, I want to be able to do this with nothing more than a txt file that has all the file names I need copying in it with every file name on a separate line.

I receive around 10 new txt files each day so you can imagine how tedious it is searching through 2000 files, picking out the 40 I need, 10 times a day everyday.

To make things even more complicated, the txt files I receive don't always have the correct file names in them, maybe there's a misspelling or a word or two missing for some of the names. That's ok when I'm going through picking out the files I need to copy myself because I can normally tell which file is being requested, but I can't see it being so easy for a program or whatever to do, I'm guessing it'll need to have a search feature where it picks out the most likely file.

I'd like it to be as automated as possible. I receive the txt file, make sure each file name is on a separate line then a program or script or whatever goes out and picks out the files (or most likely files f... Read more

A:search multiple files, copy+paste to new folder (batch file software?)

Contact Rent-A-Coder, Elance, or any of the other programming for hire sites. They could knock this out pretty quickly I would think.

5 more replies
Answer Match 78.96%

Hi all,
I need help to create windows batch file for following requirements.
1. Remove .txt and .log file format in sub folders.
2. Zip individual file inside any sub folders and give file name through command prompt. 
3. Create sub folder zip file include file zip

More replies
Answer Match 77.28%

I would like to add some info here as I had the above problem, and couldn't find the answer anywhere except on a site that wanted money! Aaargh! The nerve of it!

But I saw a topic here with the exact same problem, although the solution was quite different. (Here: http://forums.techguy.org/windows-xp/944096-taskkill-does-not-work-batch.html )

I can't recall now why I thought about the firewall, but as you guys have helped me in the past, I'd like to leave some information here for people who Google the following problems and think they have found a site with a solution, only to find that the site wants your credit card number. Bah!

Here are the errors I had:

1. Net stop: System Error 5 has occurred. Access is Denied

2. Tasklist or Taskkill: The RPC server is unavailable

Both of my problems were caused by the Comodo firewall on a new PC running XP SP3.
The startup command file calls various other command files and I got the above errors when they executed the Net, Taskkill and Tasklist commands.

When I entered the commands (net stop, taskkill, tasklist) at a command prompt, they worked.

The problem was because the Comodo firewall had a "Defence +" setting for a "Sandbox" that was enabled.
When I disabled the sandbox, everything worked as I expected, i.e. as on my old PC that I was replacing.

I hope this helps someone in the future.

If you tech guys would like to add some techy details as to what the sandbox was doing, that would be g... Read more

More replies
Answer Match 76.86%

Good Day All,

Sorry for my bad English

I am trying to do backup using batch file

this is source path "E:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\Backup\SBO"
this is target path "F:\July 2012"

source path contains files with yesterday, day before yesterday and 2days before yesterday date backup files (each day backup file size nearly 20GB)
But i want to copy only yesterday files to target path compaing date specified

Please help me. I need a batch file code to do this work.

Any help greatly appreciated

Regards,
Nuthan
 

A:Batch file command for comparing files using ""date specified

14 more replies
Answer Match 76.44%

I would like to know if there is a way to open a file in a program. Basically I want something like this (this is totally wrong):

open "C:Users\*My name*\My Documents\run.swf" in "C:\Program Files (x86)\Mozilla Firefox\firefox.exe

Thanks
 

A:Create a batch file to open a certain file in a certain file

The more standard way to do that is to use the start cmd. You call the program first and the file name second.

start "" "c:\windows\notepad.exe" "c:\somepath\logfile.txt"
 

2 more replies
Answer Match 76.44%

I'm currently in the process of copying files back from the cloud in the exact same location where I had them before and now it says that the file name is too long and prompts to see whether I want to skip the file or not. The error message given does not
give the full file name or the path so it is impossible to see which files were copied successfully or not. This never happened with XP! Then afterwards I found that some of the files with long names did copy successfully whereas others didn't. I find this
to be a very user unfriendly process and I'm totally confused! These are critical files and I'm sure I haven't exceeded 260 characters or whatever. This is soOoO frustrating!!

C

A:file copy error message not sufficient + file name too long will not copy

Hi ,

There is a limit of filename length within Windows Explorer. In the Windows API (with some exceptions discussed in the following paragraphs), the maximum length for a path is MAX_PATH, which
is defined as 260 characters.
The shell and the file system have different requirements. It is possible to create a path with the Windows API that the shell user interface is not able to interpret properly.
This means that your long filename can only be handled at the command prompt level and you cannot drag and drop an illegal length filename within Windows Explorer.

Please simplify your folders and titles.

More information, please check the part of Maximum Path Length Limitation in the link below.
http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspxTracy Cai
TechNet Community Support

5 more replies
Answer Match 75.18%

Hello,

I need help to create an Excel macro that would

1. ask users to select x number of rows to be copied from one worksheet of one Excel file
2. once users have selected the rows to be copied, then the rows are copied from the one original Excel file into X number of target Excel files

Notes:
the target Excel files are all based on the same template
there is one worksheet in each of the target Excel files

in the target files, the rows should be copied from the first available empty row, going down

Looking forward to your help!

Thanks a lot.
Mzz
 

A:Macro needed to copy x number of rows from one Excel file into a batch of Excel files

Hi, welcome to the board.
Not much info there to get the correct picture.
Sample? Of source and template please
And not to forget, what version of Excel are you and the users using?
 

1 more replies
Answer Match 75.18%

I have created a batch file(file1.bat) to run on every machine to create a batch file(file2.bat) to a launch a page at windows startup.
This is the content of file1.bat:
@echo off
@echo>"C:\Users\User\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\file2.bat
@echo start http://www.msn.com/> C:\Users\User\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\file2.bat
Expected result is to copy the file2.bat to startup of each user profile.  The file2.bat is not copied to the startup folder on windows 7, 8, 10.
However, this will work on file1.bat:
@echo off
@echo>"C:\Testing\file2.bat
@echo start http://www.msn.com/> C:\Testing\file2.bat
I do not have a domain joined network.  I need to send the file1.bat to all staff.  I plan to deploy to C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup. 

Thanks in advance to all.  Any help is appreciated. 

More replies
Answer Match 75.18%

I have created a batch file(file1.bat) to run on every machine to create a batch file(file2.bat) to a launch a page at windows startup.
This is the content of file1.bat:
@echo off
@echo>"C:\Users\User\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\file2.bat
@echo start http://www.msn.com/> C:\Users\User\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\file2.bat
Expected result is to copy the file2.bat to startup of each user profile.  However, The file2.bat is not copied to the startup folder on windows 7, 8, 10 after testing.
However, this will work in file1.bat:
@echo off
@echo>"C:\Testing\file2.bat
@echo start http://www.msn.com/> C:\Testing\file2.bat
I do not have a domain joined network.  I need to send the file1.bat to all staff.  I plan to deploy to C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup. 

Thanks in advance to all.  Any help is appreciated. 

More replies
Answer Match 73.92%

I've been searching the web on how to accomplish this but am coming up empty handed so I am hoping someone here can help...

I want my batch file to read a random line from a text file into an environment variable - can this be done?

I am using Windows 2000.
 

A:Batch File -- Read Random Line from External File into an Environment Variable

6 more replies
Answer Match 73.92%

Dear All,

I need to create a batch file which can read the size of file(e.g. 1kb, 2kb...etc) from specific folder and detect 0kb file and convert it to text file (showing 0kb file size) with alarm.

I am not really sure how to write command for this batch file. Please help :-(
 

A:How to create a batch file to read size of file on specific folder path

10 more replies
Answer Match 73.92%

I am trying to write a batch program the list the current directory files that end in *.dwg
into a file on my C drive.
I have used the following code:
dir *.dwg /b >C:FileListing.txt
start notepad C:FileListing.txt

This code only gives file names in the current directory.
I need to have a list of path and file names in the file FileListing.txt
Is there a way to do that without including subdirectories??

Thank you,
 

A:Solved: Batch file to list file names in current Folder.

9 more replies
Answer Match 73.92%

I'm working on a batch file that will download a file I maintain, look for a string of text, and if it doesn't find the string, rename a file or folder, or change the file or folder's attributes to read-only.

I think I can handle the last part, and I already have the ftp part done, but I am having a hard time finding any good resource for the text string lookup/IF statement.

Any help is greatly appreciated. I'm new here, please excuse my ignorance if I am posting in the wrong area or violating any rules.

Thanks,
Jash
 

A:Batch file to compare text and rename file or driectory on fail

6 more replies
Answer Match 73.92%

How to create a batch file that will move files based on the file type?

My Requirement : I need a batch file to copy all .doc files in all my HardDisk to a removable disk say (Z: drive) . Can anyone make it possible using a batch file?Please...Its urgent...

A:How to create a batch file that will move files based on the file type

Download XXCopy
XXCOPY, A Versatile File Management Utility --- Boldly Extended Xcopy
This is a vastly improved and extended version of DOS XCopy
Sorry, can't remember the syntax, but its quite simple if you read the manuel carefully :-)
Put the command line in a .bat file and it will run

4 more replies
Answer Match 73.92%

I created this batch file to log certain users logins. It creates a text file to log in, but doesn't populate any of the data to it. Could someone please take a look at it and see what I did wrong. I'm new to writing batch files.

Thanks in advance. Here is the code.

@echo off
set target=JDoe
if %username% == target echo %username% %date% %time% %computername% >> c:\logfile.txt
 

A:Solved: Batch file creates text file but does not populate data to it

target is a variable. You have to surrournd it with %% like any other variable.
Code:

C:\>set target=Squashman

C:\>if %username% == %target% echo %username% %date% %time% %computername% >> c:
\logfile.txt

C:\>type logfile.txt
Squashman Fri 05/23/2008 10:34:14.74 BUMBLE-BEE

C:\>

 

3 more replies
Answer Match 73.92%

If anyone can help it will be greatly appreciated,I am taking A + Essentials and my instructor isn't explaining it,

A:How to switch file type name to contents using a batch file for notepad

If you are as it appears you are paying for a Course for a Comptia A+ certification and the teacher isn't doing the job why haven't you gone to the school and asked them to switch you to a course with a different instructor? Or Demand a refund?

When I got my A+ back in 2000 it wasn't that hard to pass. I believe it was two tests and I was over 95% on both with no training course. I was experienced in computers and doing things and They did have a sample test as I recall it.

And of course that old standby Google
http://www.google.com/search?sclient=psy-ab&hl=en&site=&source=hp&q=A+%2B+Essentials&btnK=Google+Search

I'm afraid I can't help you further as the tests have changed a lot over the years.

1 more replies
Answer Match 73.92%

Hi . I'm making a "PC TuneUp" project , but something is wrong . When the batch file tries to check for updates , it closes . Fortunately , i know that it closes because it doesn't find the file . But i tried everything - nothing worked . Please help !
Code:

@echo off
for /F "tokens=1" %%G in ('tasklist /V /NH /FO TABLE /FI "WINDOWTITLE eq TehDansorz"') do IF %%G==cmd.exe exit /b
if exist newest%winver%pctuneup.ver del newest%winver%pctuneup.ver
if exist %winver%pctuneup.ver del %winver%pctuneup.ver
set winver=Win7+WinVista
set ver=1.6a
set title=title TehDansorz's PC TuneUp for Win7/WinVista Version %ver%
title Requesting admin permissions ...

:: BatchGotAdmin
::-------------------------------------
REM --> Check for permissions
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"

REM --> If error flag set, we do not have admin.
if '%errorlevel%' NEQ '0' (
echo Administrator privileges are required for this app to work .
echo Please click OK in the following screen .
PING 1.1.1.1 -n 1 -w 600 >NUL
goto UACPrompt
) else ( goto gotAdmin )

:UACPrompt
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"

"%temp%\getadmin.vbs"
exit /B

:gotAdmin
title Got a... Read more

A:Solved: Batch file closes when downloading version file

7 more replies
Answer Match 73.92%

Hi,

I have a file in a folder on a network drive whose path is : "\\sql\imp\ssis"

I need a windows batch file that looks into the above folder for a file with a name like : "abcd_03052012_84373.txt" .

The above file name has a date embedded in it in "ddmmyyyy" format. I want that to be extracted and put into a variable or a file somewhere so that I can read that later and store into a sql table.

Please help.
 

A:Solved: Extract Date from File Name - Using Windows Batch File

6 more replies
Answer Match 73.92%

I've come into contact with Mandriva Linux. I know of a concept called standard permissions, that it provides. It's pretty convienient. I don't exactly know how it really works under the hood or anything, and I don't need to know exactly how it works right now either, even though it's probably available.

What I want to do, in effect, is create a feature pretty close to equivelant of this feature, only for Windows XP. I want to set standard permissions using a batch file. Whenever this batch file is run as administrator it can enforce the permissions. What are these permissions it enforces? Well, what I want is for these permissions to be gotten from a text file. The syntax in no way resembles the syntax of the Linux file I'm describing.

Basically the syntax is this:
PATH <TAB> MODE <TAB> USER1,USER2,... <TAB> PERM
PATH <TAB> MODE <TAB> USER1,USER2,... <TAB> PERM
...
The path is the path to a file or folder in exact syntax. The mode is one of the switches that can be given for XCACLS in the Windows Resource Kit thingy. This can be replace, edit, etc. The users are the user or group to add/replace/remove/etc, and there is a comma allowed so more than one user or group is allowed to be specified. The permissions are the permissions that you can specify in the utillity.

So the first thing the script needs to do, is call some program that safely detects whether or not the filesystem is NTFS or not. If the sys... Read more

A:Get ACL permissions from a text file enforced by a batch file in Windows XP

16 more replies
Answer Match 73.92%

More as an alternative to twiddling my thumbs than anything else, I tried to produce a batch file that would count up the number and size of files in a folder, as well as the number and size of files with each extension. Hence it would say how many word documents I have and how much space they're taking up, etc.

I've managed to get a vaguely working model, but the output formatting is terrible (I just wanted it to say X bytes in Y "Z" Files, none of that ugly dotted variable names) and I have failed to get it to equate .htm and .html, .jpg and .jpeg, etc.
Code:
@ECHO OFF
REM THIS BATCH FILE ITTERATES THROUGH ALL THE SUBFOLDERS AND FILES IN A FOLDER (IDEALLY A DRIVE)
REM IT TOTALS THE NUMBER OF FILES CONTAINED IN THAT FOLDER, AND THE SIZE OF THOSE FILES.
REM IT ALSO TOTALS THE NUMBER AND SIZE OF FILES WITH EACH EXTENSION IT ENCOUNTERS.
REM ALL INFORMATION IS THEN PRINTED TO THE SCREEN AND FTYPEDST.TXT

IF EXIST FTypeDst.txt ERASE FTypeDst.txt
ECHO. >FTypeDst.txt
ATTRIB +A FTypeDst.txt

ECHO SCANNING FILE TREE FOR FILE EXTENSION DISTRIBUTION
ECHO Please Wait Paitently. . .

(SET /A ALLNUMBER = 0) & (SET /A ALLSIZE = 0)

REM cycle through the current directory and subs, Increment Allnumber, Allsize, define and increment Number of * files, size of * files.
FOR /R %%F in (*) DO (
SET /A ALLNUMBER += 1
SET /A ALLSIZE += %%~ZF
IF NOT DEFINED Number.of.%%~XF.files (SET /A Number.of.%%~XF.files = 0)
IF NOT DEFINED Size.of.%%~XF.files (SET /A Size.of.%%~X... Read more

A:Solved: File Type Distribution analysis: Batch File.

Posted via Mobile Device
You would be better off using third party software that already does this. Plenty of them out there.
I personally would check the extension of each file using the cmd extensions of a for loop. then do an if statement for each file type you want to keep track of. then use a call statement to branch to a function that adds up the file sizes and number of files.
 

3 more replies
Answer Match 73.92%

I want a batch to select and open a random link file in a folder i have. All the links are music videos I like to listen to, and I kind of want to just have an option for 'surprise me!'.
I can change the file names if I have to, and I have a basic batch file ability. I know the simple commands, but nothing of the variables, signs-involving commands (&%!?), etc.

Also, I want to learn a whole lot more about programming/java/batch file, so it'd be awesome if any code could be explained. Thank you, in advance

A:I need a batch file to open a random file within a certain folder/path

There's a free Windows scripting language called Autoit3 that would do this task easily using these functons:

Random
_FileListToArray

AutoIt - AutoItScript
It has a Basic like syntax and is easy to learn.

Another popular scripting for Windows is AutoHotkey
AutoHotkey: macro and automation Windows scripting language

The syntax can be confusing but it has object support and is more powerful.

Of course there are tons of others for Windows:
Rexx
Python
Perl
Ruby

Here's a list. The details for each tell which OS are supported:
Free Programming Languages - Freebyte's Guide to

5 more replies
Answer Match 73.92%

I have a computer that is a drone specifically for an outside LED sign. This computer is designed to never shut off and doesn't have any other program on it besides Operating System and the sign software. I need to create a batch file that I can place in the "start-up" folder that will open the program (LEDStudio10) and open the file that I want to play. I have already tried multiple attempts and I was hoping someone out there in sevenforums world would be able to point me in the right direction.

A:batch file open file for program in the startup folder

Task Scheduler. Create a new/basic task. You can invoke your batch script there. This can occur after boot completes, after user logon, etc. You can set it to run daily weekly hourly, etc. You can even have it delay X (preseleted time amounts) minutes/hours after boot/logon if you want.

Task Scheduler - Create New Task

1 more replies
Answer Match 73.92%

Hi there forum,

how do you change the Visual effects using a batch file or registry file.

Thanks,

Edward.

A:How to change visual effects using batch file or registry file?

Hello Edward, and welcome to Ten Forums.

The links in the blue note box under OPTION FOUR in the tutorial below may be able to help with this.

Visual Effects Settings - Change in Windows 10

more replies