Help debugging simple .bat that worked on XP

jubxie

New member
Local time
11:10 PM
Messages
9
Location
Seattle
Hello,

I have a backup .bat that I have hobbled together from forums such as this. The original was made a few years ago. It worked flawlessly, until I brought it to windows 7. Very funny, now, it only works between 10am and midnight. This has been hell to figure out because sometimes it works and sometimes it doesn't. I know it has something to do with the context of the "set hour" or "if "%hour.." part, but I can't figure it out. Should be an easy fix for someone familiar with .bat programming. Here is the relevant part:

Code:
set hour=%time:~0,2%
if "%hour:0,1%"=="  "set hour=0%time:~1,1%
set folder=%date:~10,4%_%date:~4,2%_%date:~7,2%-%hour%.%time:~3,2%
set DateFolder=%date:~10,4%_%date:~4,2%_%date:7,2%

Let me know if you need more info. I have to hand type the code, since the original is on a non-networked machine. Thanks!
 

My Computer

OS
Windows 7 Pro x64
Hi jubxie and welcome to W7 Forums :party:

Change the second line to the following: if "%hour:~0,1%"==" "set hour=0%time:~1,1%
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Dwarf Dwf/11/2012 r09/2013
OS
Windows 8.1 Pro RTM x64
CPU
Intel Core-i5-3570K 4-core @ 3.4GHz (Ivy Bridge) (OC 4.4GHz)
Motherboard
ASRock Z77 Extreme4-M
Memory
4 x 4GB DDR3-1600 Corsair Vengeance CMZ8GX3M2A1600C9B (16GB)
Graphics Card(s)
MSI GeForce GTX770 Gaming OC 2GB
Sound Card
Realtek High Definition on board solution (ALC 898)
Monitor(s) Displays
ViewSonic VA1912w Widescreen (VGA)
Screen Resolution
1440x900
Hard Drives
OCZ Agility 3 SSD 120GB SATA III x2 (RAID 0)
Samsung HD501LJ 500GB SATA II x2
Hitachi HDS721010CLA332 1TB SATA II
Iomega 1.5TB Ext USB 2.0
WD 2.0TB Ext USB 3.0
PSU
XFX Pro Series 850W Semi-Modular
Case
Gigabyte IF233
Cooling
1 x 120mm Front Inlet 1 x 120mm Rear Exhaust
Keyboard
Microsoft Comfort Curve Keyboard 3000 (USB)
Mouse
Microsoft Comfort Mouse 3000 for Business (USB)
Internet Speed
NetGear DG834Gv3 ADSL Modem/Router (Ethernet) ~4.0 Mb/s (O2)
Antivirus
Avast! 8.0.1497
Browser
IE 11
Other Info
Optical Drive: HL-DT-ST BD-RE BH10LS30 SATA Bluray
Lexmark S305 Printer/Scanner/Copier (USB)
WEI Score: 8.1/8.1/8.5/8.5/8.25
Asus Eee PC 1011PX Netbook (Windows 7 x86 Starter)
Thank you for the help. My mistake. That is what I have in the .bat. I had a typo in my post. I never had any trouble with this before on XP pro SP3. If it helps, the meat of the .bat is a command to place the contents of a folder in a .zip file using 7zip and robocopying the data to a server. Those commands all work correctly on the command line, stand alone. Any other ideas?
 

My Computer

OS
Windows 7 Pro x64
Looks awful complicated, would this be easier?

Code:
@ECHO OFF
ECHO TIME IS %TIME%
ECHO DATE IS %DATE%

set hour=%time:~0,2%
set mn=%TIME:~3,2%
set sc=%TIME:~6,2%
set msec=%TIME:~9,2%
if %hour% equ 0: set hour=00
echo.
set day=%date:~0,2%
set mth=%DATE:~3,2%
set yr=%DATE:~6,4%
echo.
set datefolder=%day%_%mth%_%yr%-%hour%*%mn%*%sc%
echo.
echo datefolder is %datefolder%
echo.
pause

outputs this:

TIME IS 21:02:58.78
DATE IS 01/06/2011

datefolder is 01_06_2011-21*02*58

Press any key to continue . . .
 

My Computers

System One System Two

  • Computer type
    PC/Desktop
    OS
    7 X64
    CPU
    i5 8400
    Motherboard
    gigabyte b365m ds3h
    Memory
    2x8gb 3200mhz
    Hard Drives
    various
    PSU
    pure power 11 400w cm
    Case
    Coolermaster
    Cooling
    cryorig m9i
  • Computer type
    PC/Desktop
    OS
    7x64
    CPU
    g5400
    Motherboard
    ga b365m ds3h
    Memory
    8gb ddr4 2400
    PSU
    xfx pro 450w
Thanks. I will try that and let you know. I'll have to wait til Friday morning before 10am, but I will post results.
 

My Computer

OS
Windows 7 Pro x64
Interesting. Running that exact (copy and paste) gave me very different results. Did you run on XP? My results:
datefolder is Fr_ 0_/03/- 7*50*52.

There must be something different about how 7 interprets this code. Any other ideas I could test before 10am PT, at which point the original code will start to work?
 

My Computer

OS
Windows 7 Pro x64
What do you see if you type date /t at a command prompt? Try on both XP and W7.
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Dwarf Dwf/11/2012 r09/2013
OS
Windows 8.1 Pro RTM x64
CPU
Intel Core-i5-3570K 4-core @ 3.4GHz (Ivy Bridge) (OC 4.4GHz)
Motherboard
ASRock Z77 Extreme4-M
Memory
4 x 4GB DDR3-1600 Corsair Vengeance CMZ8GX3M2A1600C9B (16GB)
Graphics Card(s)
MSI GeForce GTX770 Gaming OC 2GB
Sound Card
Realtek High Definition on board solution (ALC 898)
Monitor(s) Displays
ViewSonic VA1912w Widescreen (VGA)
Screen Resolution
1440x900
Hard Drives
OCZ Agility 3 SSD 120GB SATA III x2 (RAID 0)
Samsung HD501LJ 500GB SATA II x2
Hitachi HDS721010CLA332 1TB SATA II
Iomega 1.5TB Ext USB 2.0
WD 2.0TB Ext USB 3.0
PSU
XFX Pro Series 850W Semi-Modular
Case
Gigabyte IF233
Cooling
1 x 120mm Front Inlet 1 x 120mm Rear Exhaust
Keyboard
Microsoft Comfort Curve Keyboard 3000 (USB)
Mouse
Microsoft Comfort Mouse 3000 for Business (USB)
Internet Speed
NetGear DG834Gv3 ADSL Modem/Router (Ethernet) ~4.0 Mb/s (O2)
Antivirus
Avast! 8.0.1497
Browser
IE 11
Other Info
Optical Drive: HL-DT-ST BD-RE BH10LS30 SATA Bluray
Lexmark S305 Printer/Scanner/Copier (USB)
WEI Score: 8.1/8.1/8.5/8.5/8.25
Asus Eee PC 1011PX Netbook (Windows 7 x86 Starter)
No, I don't have XP.

Might be different on an ancient o/s.

Try just checking what it gives you for %time% and %date% - try directly in cmd window, like this:

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Windows\System32>ECHO TIME IS %TIME%
TIME IS 16:01:11.39

C:\Windows\System32>ECHO DATE IS %DATE%
DATE IS 03/06/2011

C:\Windows\System32>

date /t should also work as Dwarf says.
 

My Computers

System One System Two

  • Computer type
    PC/Desktop
    OS
    7 X64
    CPU
    i5 8400
    Motherboard
    gigabyte b365m ds3h
    Memory
    2x8gb 3200mhz
    Hard Drives
    various
    PSU
    pure power 11 400w cm
    Case
    Coolermaster
    Cooling
    cryorig m9i
  • Computer type
    PC/Desktop
    OS
    7x64
    CPU
    g5400
    Motherboard
    ga b365m ds3h
    Memory
    8gb ddr4 2400
    PSU
    xfx pro 450w
Date: Fri 06/03/2011

Time: 8:05:59:18

Thanks
 
Last edited:

My Computer

OS
Windows 7 Pro x64
Fri 06/03/2011

Looks like the issue.

Recent o/s don't output the day.

Also, is that 8AM ?

8:05:59:18

Different from 08:05:59:18
 

My Computers

System One System Two

  • Computer type
    PC/Desktop
    OS
    7 X64
    CPU
    i5 8400
    Motherboard
    gigabyte b365m ds3h
    Memory
    2x8gb 3200mhz
    Hard Drives
    various
    PSU
    pure power 11 400w cm
    Case
    Coolermaster
    Cooling
    cryorig m9i
  • Computer type
    PC/Desktop
    OS
    7x64
    CPU
    g5400
    Motherboard
    ga b365m ds3h
    Memory
    8gb ddr4 2400
    PSU
    xfx pro 450w
Ok. You need to change the following lines in the above code:

Windows 7 compliant
Code:
set day=%date:~0,2%
set mth=%DATE:~3,2%
set yr=%DATE:~6,4%
Windows XP equivalent
Code:
set day=%date:~4,2%
set mth=%DATE:~7,2%
set yr=%DATE:~10,4%
The changes involve adding 4 to each of the pointers in order to jump over the unwanted part of the date in XP. There should be a way to incorporate both blocks of the above code into a batch file, and ensure that the correct section is executed dependant on the system the file is run on.

The code in the following link should be able to help. I'll see if I can extract the necessary part and incorporate it into a new version of the batch file.

http://stackoverflow.com/questions/...ows-and-or-cmd-exe-a-batch-file-is-running-on
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Dwarf Dwf/11/2012 r09/2013
OS
Windows 8.1 Pro RTM x64
CPU
Intel Core-i5-3570K 4-core @ 3.4GHz (Ivy Bridge) (OC 4.4GHz)
Motherboard
ASRock Z77 Extreme4-M
Memory
4 x 4GB DDR3-1600 Corsair Vengeance CMZ8GX3M2A1600C9B (16GB)
Graphics Card(s)
MSI GeForce GTX770 Gaming OC 2GB
Sound Card
Realtek High Definition on board solution (ALC 898)
Monitor(s) Displays
ViewSonic VA1912w Widescreen (VGA)
Screen Resolution
1440x900
Hard Drives
OCZ Agility 3 SSD 120GB SATA III x2 (RAID 0)
Samsung HD501LJ 500GB SATA II x2
Hitachi HDS721010CLA332 1TB SATA II
Iomega 1.5TB Ext USB 2.0
WD 2.0TB Ext USB 3.0
PSU
XFX Pro Series 850W Semi-Modular
Case
Gigabyte IF233
Cooling
1 x 120mm Front Inlet 1 x 120mm Rear Exhaust
Keyboard
Microsoft Comfort Curve Keyboard 3000 (USB)
Mouse
Microsoft Comfort Mouse 3000 for Business (USB)
Internet Speed
NetGear DG834Gv3 ADSL Modem/Router (Ethernet) ~4.0 Mb/s (O2)
Antivirus
Avast! 8.0.1497
Browser
IE 11
Other Info
Optical Drive: HL-DT-ST BD-RE BH10LS30 SATA Bluray
Lexmark S305 Printer/Scanner/Copier (USB)
WEI Score: 8.1/8.1/8.5/8.5/8.25
Asus Eee PC 1011PX Netbook (Windows 7 x86 Starter)
This is why I love Powershell, you can ask for a special date format instead of depending on the system to provide one you need. As well as a lot more power in Powershell.

Code:
$filedate = get-date -format "yyyy_MM_dd-HH*mm*ss"
// 2011_06_03-08*42*42
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Alienware Aurora ALX R4
OS
Windows 10 Pro (x64)
CPU
Intel Core i7-3930K (3.2GHz - 4.5GHz)
Motherboard
Alienware Aurora-R4 x79
Memory
4x Samsung 4GB PC3-12800 DDR3 (16GB 1600MHz)
Graphics Card(s)
Nvidia Geforce GTX 690
Sound Card
SteelSeries Siberia Elite
Monitor(s) Displays
Dell UltraSharp U3011
Screen Resolution
2560x1600
Hard Drives
Samsung 850 Pro 256 GB, Seagate 1TB Desktop Hybrid HDD, 2x Western Digital 4TB Green HDD
PSU
875W Some Dell PSU <.<
Case
Alienware Aurora ALX
Cooling
Custom Liquid Cooling (EK CPU & GPU blocks) dual EK 480RAD
Keyboard
Logitech G710+ Mechanical
Mouse
Logitech G700s
Internet Speed
Verizon Fios (50 mbps average)
Other Info
Server: Intel NUC D54250WYK: i5-4250U, 16GB, 256 GB mSATA, Windows Server 2012 R2
Here you go.

Code:
@ECHO OFF
ECHO TIME IS %TIME%
ECHO DATE IS %DATE%
set hour=%time:~0,2%
set mn=%TIME:~3,2%
set sc=%TIME:~6,2%
set msec=%TIME:~9,2%
if %hour% equ 0: set hour=00
for /f "tokens=2 delims=[]" %%G in ('ver') Do (set _version=%%G)
for /f "tokens=2,3,4 delims=. " %%G in ('echo %_version%') Do (set _major=%%G& set _minor=%%H& set _build=%%I)
if "%_major%"=="5" goto sub5
if "%_major%"=="6" goto sub6
goto error
:sub5
set day=%date:~4,2%
set mth=%DATE:~7,2%
set yr=%DATE:~10,4%
goto finish
:sub6
set day=%date:~0,2%
set mth=%DATE:~3,2%
set yr=%DATE:~6,4%
goto finish
:error
echo "unsupported OS."
echo.
pause
pause
exit
:finish
set datefolder=%day%_%mth%_%yr%-%hour%*%mn%*%sc%
echo datefolder is %datefolder%
echo.
pause
pause
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Dwarf Dwf/11/2012 r09/2013
OS
Windows 8.1 Pro RTM x64
CPU
Intel Core-i5-3570K 4-core @ 3.4GHz (Ivy Bridge) (OC 4.4GHz)
Motherboard
ASRock Z77 Extreme4-M
Memory
4 x 4GB DDR3-1600 Corsair Vengeance CMZ8GX3M2A1600C9B (16GB)
Graphics Card(s)
MSI GeForce GTX770 Gaming OC 2GB
Sound Card
Realtek High Definition on board solution (ALC 898)
Monitor(s) Displays
ViewSonic VA1912w Widescreen (VGA)
Screen Resolution
1440x900
Hard Drives
OCZ Agility 3 SSD 120GB SATA III x2 (RAID 0)
Samsung HD501LJ 500GB SATA II x2
Hitachi HDS721010CLA332 1TB SATA II
Iomega 1.5TB Ext USB 2.0
WD 2.0TB Ext USB 3.0
PSU
XFX Pro Series 850W Semi-Modular
Case
Gigabyte IF233
Cooling
1 x 120mm Front Inlet 1 x 120mm Rear Exhaust
Keyboard
Microsoft Comfort Curve Keyboard 3000 (USB)
Mouse
Microsoft Comfort Mouse 3000 for Business (USB)
Internet Speed
NetGear DG834Gv3 ADSL Modem/Router (Ethernet) ~4.0 Mb/s (O2)
Antivirus
Avast! 8.0.1497
Browser
IE 11
Other Info
Optical Drive: HL-DT-ST BD-RE BH10LS30 SATA Bluray
Lexmark S305 Printer/Scanner/Copier (USB)
WEI Score: 8.1/8.1/8.5/8.5/8.25
Asus Eee PC 1011PX Netbook (Windows 7 x86 Starter)
Sorry if I am adding confusion. This is all being done on Win 7 Pro x64
Fri 06/03/2011

Looks like the issue.

Recent o/s don't output the day.

Also, is that 8AM ?

8:05:59:18

Different from 08:05:59:18

8:05:59:18 is what is output. Yep, that 8am.


Ok. You need to change the following lines in the above code:

Windows 7 compliant
Code:
set day=%date:~0,2%
set mth=%DATE:~3,2%
set yr=%DATE:~6,4%
Windows XP equivalent
Code:
set day=%date:~4,2%
set mth=%DATE:~7,2%
set yr=%DATE:~10,4%
The changes involve adding 4 to each of the pointers in order to jump over the unwanted part of the date in XP. There should be a way to incorporate both blocks of the above code into a batch file, and ensure that the correct section is executed dependant on the system the file is run on.

The code in the following link should be able to help. I'll see if I can extract the necessary part and incorporate it into a new version of the batch file.

how to tell what version of windows and/or cmd.exe a batch file is running on? - Stack Overflow

I have the 7 compliant code in and it gives me a strange folder structure.
I get folder 03 w/ subfolder under it of "_" and "_0_day"

Maybe more info is needed. The folder is created correctly w/ orginal code, but the batch doesn't run correctly.

Here' the whole(relevant) code:
Code:
set hour=%time:~0,2%
if "%hour:~0,1%"==" "set hour=0%time:~1,1%
set folder=%date:~10,4%_%date:~4,2%_%date:~7,2%-%hour%.%time:~3,2%
set DateFolder=%date:~10,4%_%date:~4,2%_%date:7,2%

mkdir "\\path\%datefolder%\"

7z a \\path\%folder%_machinename.zip \\path -xr!_backup -xr!Archive -ssw

There's more, but that's the part that isn't working until 10am. Maybe it's a 7zip issue? The archive part was added for Win7 (I think I'm making a liar out of myself saying it worked on XP. I was sure it was a date/time context issue). 7zip tells me it can't find the .zip it's supposed to create, and continues on creating a .7z archive file instead of .zip. The "%datefolder%_machinename.zip file comes out with a "9.31_machinename.zip(thats 9:31am). The system cannot find the file specified. Again, until 10am. (using the original code)Then everything works great. I really appreciate the help!
 

My Computer

OS
Windows 7 Pro x64
Ok. Try this. It modifies the hour parameter so that it is always 2 characters long.
Code:
@ECHO OFF
ECHO TIME IS %TIME%
ECHO DATE IS %DATE%
set hour=%time:~0,2%
set mn=%TIME:~3,2%
set sc=%TIME:~6,2%
set msec=%TIME:~9,2%
for /f "tokens=2 delims=[]" %%G in ('ver') Do (set _version=%%G)
for /f "tokens=2,3,4 delims=. " %%G in ('echo %_version%') Do (set _major=%%G& set _minor=%%H& set _build=%%I)
if "%_major%"=="5" goto sub5
if "%_major%"=="6" goto sub6
goto error
:sub5
set day=%date:~4,2%
set mth=%DATE:~7,2%
set yr=%DATE:~10,4%
goto finish
:sub6
set day=%date:~0,2%
set mth=%DATE:~3,2%
set yr=%DATE:~6,4%
goto finish
:error
echo "unsupported OS."
echo.
pause
pause
exit
:finish
if %hour% geq 10 goto finish1
set hour=0%hour:~1,2%
:finish1
set datefolder=%day%_%mth%_%yr%-%hour%*%mn%*%sc%
echo datefolder is %datefolder%
echo.
pause
pause
This means that if datefolder was 03_06_2011- 6*30*30 it will now be 03_06_2011-06*30*30. In other words, if the hours value is between 0 and 9, an additional leading 0 will be appended.
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Dwarf Dwf/11/2012 r09/2013
OS
Windows 8.1 Pro RTM x64
CPU
Intel Core-i5-3570K 4-core @ 3.4GHz (Ivy Bridge) (OC 4.4GHz)
Motherboard
ASRock Z77 Extreme4-M
Memory
4 x 4GB DDR3-1600 Corsair Vengeance CMZ8GX3M2A1600C9B (16GB)
Graphics Card(s)
MSI GeForce GTX770 Gaming OC 2GB
Sound Card
Realtek High Definition on board solution (ALC 898)
Monitor(s) Displays
ViewSonic VA1912w Widescreen (VGA)
Screen Resolution
1440x900
Hard Drives
OCZ Agility 3 SSD 120GB SATA III x2 (RAID 0)
Samsung HD501LJ 500GB SATA II x2
Hitachi HDS721010CLA332 1TB SATA II
Iomega 1.5TB Ext USB 2.0
WD 2.0TB Ext USB 3.0
PSU
XFX Pro Series 850W Semi-Modular
Case
Gigabyte IF233
Cooling
1 x 120mm Front Inlet 1 x 120mm Rear Exhaust
Keyboard
Microsoft Comfort Curve Keyboard 3000 (USB)
Mouse
Microsoft Comfort Mouse 3000 for Business (USB)
Internet Speed
NetGear DG834Gv3 ADSL Modem/Router (Ethernet) ~4.0 Mb/s (O2)
Antivirus
Avast! 8.0.1497
Browser
IE 11
Other Info
Optical Drive: HL-DT-ST BD-RE BH10LS30 SATA Bluray
Lexmark S305 Printer/Scanner/Copier (USB)
WEI Score: 8.1/8.1/8.5/8.5/8.25
Asus Eee PC 1011PX Netbook (Windows 7 x86 Starter)
Thanks Dwarf. I'll try it tomorrow morning (before 10am :) Logicearth: Thanks. Yeah, I have hobbled together an auditing script with powershell, but I'm even less comfortable with it. Seems like that's were this stuff is going though.
 

My Computer

OS
Windows 7 Pro x64
You're welcome. I'll optimise the code and post back.
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Dwarf Dwf/11/2012 r09/2013
OS
Windows 8.1 Pro RTM x64
CPU
Intel Core-i5-3570K 4-core @ 3.4GHz (Ivy Bridge) (OC 4.4GHz)
Motherboard
ASRock Z77 Extreme4-M
Memory
4 x 4GB DDR3-1600 Corsair Vengeance CMZ8GX3M2A1600C9B (16GB)
Graphics Card(s)
MSI GeForce GTX770 Gaming OC 2GB
Sound Card
Realtek High Definition on board solution (ALC 898)
Monitor(s) Displays
ViewSonic VA1912w Widescreen (VGA)
Screen Resolution
1440x900
Hard Drives
OCZ Agility 3 SSD 120GB SATA III x2 (RAID 0)
Samsung HD501LJ 500GB SATA II x2
Hitachi HDS721010CLA332 1TB SATA II
Iomega 1.5TB Ext USB 2.0
WD 2.0TB Ext USB 3.0
PSU
XFX Pro Series 850W Semi-Modular
Case
Gigabyte IF233
Cooling
1 x 120mm Front Inlet 1 x 120mm Rear Exhaust
Keyboard
Microsoft Comfort Curve Keyboard 3000 (USB)
Mouse
Microsoft Comfort Mouse 3000 for Business (USB)
Internet Speed
NetGear DG834Gv3 ADSL Modem/Router (Ethernet) ~4.0 Mb/s (O2)
Antivirus
Avast! 8.0.1497
Browser
IE 11
Other Info
Optical Drive: HL-DT-ST BD-RE BH10LS30 SATA Bluray
Lexmark S305 Printer/Scanner/Copier (USB)
WEI Score: 8.1/8.1/8.5/8.5/8.25
Asus Eee PC 1011PX Netbook (Windows 7 x86 Starter)
Optimised code (including error trapping).
Code:
@ECHO OFF
set hour=%time:~0,2%
if %hour% lss 10 set hour=0%hour:~1,2%
for /f "tokens=2 delims=[]" %%G in ('ver') Do (set _version=%%G)
for /f "tokens=2,3,4 delims=. " %%G in ('echo %_version%') Do (set _major=%%G& set _minor=%%H& set _build=%%I)
if %_major% lss 5 goto error
if %_major% gtr 6 goto error
if "%_major%"=="5" set datefolder=%date:~4,2%_%date:~7,2%_%date:~10,4%-%hour%*%time:~3,2%*%time:~6,2%
if "%_major%"=="6" set datefolder=%date:~0,2%_%date:~3,2%_%date:~6,4%-%hour%*%time:~3,2%*%time:~6,2%
goto finish
:error
echo "Unsupported OS."
echo.
pause
exit
:finish
mkdir "\\path\%datefolder%\"
7z a \\path\%folder%_machinename.zip \\path -xr!_backup -xr!Archive -ssw
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Dwarf Dwf/11/2012 r09/2013
OS
Windows 8.1 Pro RTM x64
CPU
Intel Core-i5-3570K 4-core @ 3.4GHz (Ivy Bridge) (OC 4.4GHz)
Motherboard
ASRock Z77 Extreme4-M
Memory
4 x 4GB DDR3-1600 Corsair Vengeance CMZ8GX3M2A1600C9B (16GB)
Graphics Card(s)
MSI GeForce GTX770 Gaming OC 2GB
Sound Card
Realtek High Definition on board solution (ALC 898)
Monitor(s) Displays
ViewSonic VA1912w Widescreen (VGA)
Screen Resolution
1440x900
Hard Drives
OCZ Agility 3 SSD 120GB SATA III x2 (RAID 0)
Samsung HD501LJ 500GB SATA II x2
Hitachi HDS721010CLA332 1TB SATA II
Iomega 1.5TB Ext USB 2.0
WD 2.0TB Ext USB 3.0
PSU
XFX Pro Series 850W Semi-Modular
Case
Gigabyte IF233
Cooling
1 x 120mm Front Inlet 1 x 120mm Rear Exhaust
Keyboard
Microsoft Comfort Curve Keyboard 3000 (USB)
Mouse
Microsoft Comfort Mouse 3000 for Business (USB)
Internet Speed
NetGear DG834Gv3 ADSL Modem/Router (Ethernet) ~4.0 Mb/s (O2)
Antivirus
Avast! 8.0.1497
Browser
IE 11
Other Info
Optical Drive: HL-DT-ST BD-RE BH10LS30 SATA Bluray
Lexmark S305 Printer/Scanner/Copier (USB)
WEI Score: 8.1/8.1/8.5/8.5/8.25
Asus Eee PC 1011PX Netbook (Windows 7 x86 Starter)
The results of the non-optimized code:
datefolder is Sa_ 0_/04/-08*31*37

EDIT: i just changed the date format in the Regonal setting, which fixed the output of the non-optimized code. I will try some more.......

The optimized also seems to have the same issue. It creates nested directory's with strange names.
I wonder if this is just not doable with windows 7 without powershell. If so, that's really a bummer cause the powershell scripts are much more complicated that what I had and what you've written. I will try your script after 10am to see if it works then.
 
Last edited:

My Computer

OS
Windows 7 Pro x64
That's it!!!!! I just had to get the date format correct so the output from the non-optimized code looked correct(does suck that it's hidden in regional settings, since I look previously and couldn't find it). And at 8:57am, I have a working backup script. And one that is much more robust than before. Can't thank you enough Dwarf. CHEERS!
 

My Computer

OS
Windows 7 Pro x64
Back
Top