Search found 82 matches

by Matt Williamson
08 Jun 2015 11:27
Forum: DOS Batch Forum
Topic: Need help synchronizing files between servers.
Replies: 17
Views: 10773

Re: Need help synchronizing files between servers.

Thanks Antonio.

I don't think this will work because the files on the new server are already in folders. Unless the for is recursive and will look into the folders. That's why I was using dir /b/s. If I'm missing something, please let me know.

Thanks!

-Matt
by Matt Williamson
08 Jun 2015 08:20
Forum: DOS Batch Forum
Topic: Need help synchronizing files between servers.
Replies: 17
Views: 10773

Re: Need help synchronizing files between servers.

The file names are all unique. So, are we talking about something like this? @echo off setlocal set "old=z:\" set "new=d:\inetpub\ftproot\XMLs" for /f "delims=" %%a in ('dir /b z:\*.xml') do ( for /f "delims=" %%b in ('dir /b/s %new%\*.xml') do ( if not %%a EQ...
by Matt Williamson
05 Jun 2015 07:18
Forum: DOS Batch Forum
Topic: Need help synchronizing files between servers.
Replies: 17
Views: 10773

Re: Need help synchronizing files between servers.

What do you want to do in the single folder now? It's going to have different files inside it I assume. Do you want to organise the single folder of files on the primary system? Yes, the single folder will have more files in it now. I don't want to do anything in the single folder but copy all of t...
by Matt Williamson
04 Jun 2015 13:14
Forum: DOS Batch Forum
Topic: Need help synchronizing files between servers.
Replies: 17
Views: 10773

Need help synchronizing files between servers.

I don't even know where to start with this one. I have 2 servers that I need to synchronize files between but on one server the files are in folders and on the other server, they are not and there are A LOT of files. 924K on the first win server 2k3 server and 914k on the win 2012 r2 server second. ...
by Matt Williamson
19 May 2015 12:32
Forum: DOS Batch Forum
Topic: Organizing XML files into year month format
Replies: 2
Views: 2552

Re: Organizing XML files into year month format

Thanks Foxidrive, I wasn't aware of this bug.

-Matt
by Matt Williamson
18 May 2015 11:31
Forum: DOS Batch Forum
Topic: Organizing XML files into year month format
Replies: 2
Views: 2552

Organizing XML files into year month format

I need to re-organize close to a million xml files that are all in the same directory so they are in year/month folders. I have written the following code to do that. The problem I'm having is how long it is taking. I ran the script and it took over an hour just to output how many files are in the d...
by Matt Williamson
30 Mar 2015 14:54
Forum: DOS Batch Forum
Topic: Read from a list of hosts instead of querying whole domain
Replies: 15
Views: 12926

Re: Read from a list of hosts instead of querying whole doma

If you're running PsLoggedOn or any of the sysinternal tools for the first time on a machine, you will get the EULA but you won't see it when scripting. There is a switch /accepteula that takes care of that little problem. Could be the cause of your issue.
by Matt Williamson
19 Mar 2015 12:01
Forum: DOS Batch Forum
Topic: Can someone smarter than me check this code?
Replies: 5
Views: 4286

Re: Can someone smarter than me check this code?

I haven't read the entire script but I have a suggestion. Make a folder in your temp directory, copy a section of your files there and run the script. No harm, No foul. If it works, great. If not, well, you know you need to fix it. Also, Backup your data! external HD's are cheap. get one.

-Matt
by Matt Williamson
19 Mar 2015 11:26
Forum: DOS Batch Forum
Topic: Interactive Menu with user Input
Replies: 3
Views: 3398

Re: Interactive Menu with user Input

Open up a cmd prompt and type set /? pay particular attention to the /p switch. This allows your script to take input while it's running.
by Matt Williamson
19 Mar 2015 11:24
Forum: DOS Batch Forum
Topic: Teeing to a script that contains CR and BS
Replies: 1
Views: 2721

Teeing to a script that contains CR and BS

I'm using the following code to make a countdown timer and a spinner in my script: :: Creates an install spinner to show :: :: activity for long running processes :: :InstallSpinner @echo off setlocal enabledelayedexpansion For /f %%a in ('copy /Z "%~dpf0" nul') Do set "CR=%%a" S...
by Matt Williamson
17 Mar 2015 07:07
Forum: DOS Batch Forum
Topic: Setting up scripting environment
Replies: 9
Views: 8312

Re: Setting up scripting environment

Nice Squashman. Now comes the tough part. It isn't picking up the settings that I've already set for any CMD window because the title isn't cmd.exe. I can get it close using MODE like so: @echo off start "" cmd.exe /K "title Batch Folder & cd /d F:\Scripts\batch & color 0A &am...
by Matt Williamson
16 Mar 2015 13:44
Forum: DOS Batch Forum
Topic: Setting up scripting environment
Replies: 9
Views: 8312

Setting up scripting environment

Every day, I come in to work and open up 2 cmd prompts. I change the titles and set each one to a specific folder. I've been trying to write the script to do this so I can just double click a file and have it done for me. I haven't figured it out yet. Something like: @echo off cmd.exe /K title test1...
by Matt Williamson
13 Mar 2015 14:30
Forum: DOS Batch Forum
Topic: Spinner until process is finished
Replies: 9
Views: 8281

Re: Spinner until process is finished

Aacini answered this on SO. Here is the code. @Echo off setLocal EnableDelayedExpansion For /f %%a in ('copy /Z "%~dpf0" nul') Do set "CR=%%a" Set "busy=|/-\" Set n=0 set "exe=notepad.exe" start "" %exe% ::BUSY SPINNER :loop tasklist /FI "Imagen...
by Matt Williamson
13 Mar 2015 11:06
Forum: DOS Batch Forum
Topic: Cannot get a bat file to work in Windows XP
Replies: 9
Views: 5938

Re: Cannot get a bat file to work in Windows XP

I know but he's working in a producton environment so WinXP pro is just an assumption. If he does need it for xp home, I have another script using ipconfig instead.
by Matt Williamson
13 Mar 2015 09:48
Forum: DOS Batch Forum
Topic: Automatically Copy From Drive to Year-Month-Day Folder
Replies: 11
Views: 6694

Re: Automatically Copy From Drive to Year-Month-Day Folder

You can do the insertion detection using WMIC or FSUTIL but I don't think either of them are available until Winxp. Also, where do you get those floppy disks? I thought they stopped making them a few years ago. Show an example of the file names for the second part. I recently wrote a script that doe...