Need help in converting the existing patch to c# console application

J

J. Hwang

Hello,

I have a client which like me to convert their existing patch to c#
console application.
I know that it should be really simple, but I'm a newbee to C#.
I also knowing how to create a subfolder with the datestamp as the
code below,
but I don't know how to do the rest.

Please help me to convert these Patch code to c# console application.
@echo off
set dd=%date:~7,2%
set mm=%date:~4,2%
set yyyy=%date:~10,4%
set folder=%yyyy%-%mm%-%dd%
set hh=%time:~0,2%
set mm=%time:~3,2%
set ss=%time:~6,2%
set file=%hh%-%mm%-%ss%
if exist "C:\MemSnap\Logs\%folder%" (
"C:\Program Files\Support Tools\memsnap" -m "C:\MemSnap\Logs\%folder%
\MemSnap%file%.log"
) else (
mkdir "C:\MemSnap\Logs\%folder%"
"C:\Program Files\Support Tools\memsnap" -m "C:\MemSnap\Logs\%folder%
\MemSnap%file%.log"
)

Thank you very much in advance!
 
M

Morten Wennevik [C# MVP]

Hi Hwang,

The following code will create a folder with a date stamp using the
Directory class and start the memsnap program using the Process class.

To get the time stamp you can use the DateTime.Now property which you can
output in any way you want using the time and date formatting codes. HH will
output the time in the 24 hour system. Use hh if you want a 12 hour system
instead. For more information check this page

[Custom Date and Time Format Strings]
http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx

[C#]
DateTime date = DateTime.Now;

string folder = date.ToString("yyyy-MM-dd");
string file = date.ToString("HH-mm-ss");

Directory.CreateDirectory(folder);

Process.Start(@"C:\Program Files\Support Tools\memsnap",
@"-m C:\MemSnap\Logs\" + folder + @"\MemSnap" + file + ".log");
 
J

J. Hwang

Hello Morten,

Thank you very much for your respond & helps.

I've tried as your advice.
I was be able to create the subfolder, but I still can't make the
memsanp to work as it should.

To my understanding, MemSnap is a Windows Server application which
will create a memory snap to a log file.
I just don't know what I'm missing, please help me again & let me know
what I'm doing wrong.

Here is my C# codes:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MemSnap
{
class MemSnap
{
static void Main(string[] args)
{
string activeDir = @"C:\MemSnap\Logs";
DateTime date = DateTime.Now;
string folder = date.ToString("yyyy-MM-dd");
string file = date.ToString("HH-mm-ss");
string newDir = System.IO.Path.Combine(activeDir, folder);

if (System.IO.Directory.Exists(newDir))
{
try
{
System.Diagnostics.Process.Start(@"C:\Program Files
\Support Tools\memsnap", @"-m C:\MemSnap\Logs\" + folder + @"\MemSnap"
+ file + ".log");
}
catch (Exception e1)
{
Console.WriteLine(e1.Message,
e1.StackTrace.ToString());
}
}
else
{
System.IO.Directory.CreateDirectory(newDir);

try
{
System.Diagnostics.Process.Start(@"C:\Program Files
\Support Tools\memsnap", @"-m C:\MemSnap\Logs\" + folder + @"\MemSnap"
+ file + ".log");
}
catch (Exception e2)
{
Console.WriteLine(e2.Message,
e2.StackTrace.ToString());
}
}
}
}
}

Thank you again in advance!
JH



Hi Hwang,

The following code will create a folder with a date stamp using the
Directory class  and start the memsnap program using the Process class.

To get the time stamp you can use the DateTime.Now property which you can
output in any way you want using the time and date formatting codes.  HH will
output the time in the 24 hour system.  Use hh if you want a 12 hour system
instead.  For more information check this page

[Custom Date and Time Format Strings]http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx

[C#]
DateTime date = DateTime.Now;

string folder = date.ToString("yyyy-MM-dd");
string file = date.ToString("HH-mm-ss");

Directory.CreateDirectory(folder);

Process.Start(@"C:\Program Files\Support Tools\memsnap",
    @"-m C:\MemSnap\Logs\" + folder + @"\MemSnap" + file + ".log");

--
Happy Coding!
Morten Wennevik [C# MVP]



J. Hwang said:
I have a client which like me to convert their existing patch to c#
console application.
I know that it should be really simple, but I'm a newbee to C#.
I also knowing how to create a subfolder with the datestamp as the
code below,
but I don't know how to do the rest.
Please help me to convert these Patch code to c# console application.
@echo off
set dd=%date:~7,2%
set mm=%date:~4,2%
set yyyy=%date:~10,4%
set folder=%yyyy%-%mm%-%dd%
set hh=%time:~0,2%
set mm=%time:~3,2%
set ss=%time:~6,2%
set file=%hh%-%mm%-%ss%
if exist "C:\MemSnap\Logs\%folder%" (
"C:\Program Files\Support Tools\memsnap" -m "C:\MemSnap\Logs\%folder%
\MemSnap%file%.log"
) else (
mkdir "C:\MemSnap\Logs\%folder%"
"C:\Program Files\Support Tools\memsnap" -m "C:\MemSnap\Logs\%folder%
\MemSnap%file%.log"
)
Thank you very much in advance!- Hide quoted text -

- Show quoted text -
 
M

Morten Wennevik [C# MVP]

Hi,

I rewrote your sample slightly. See if that works. I don't have access to
memsnap here so I can't verify that the code works, though. For future
reference, it helps if you provide some detail around the problem as "memsnap
does not work as it should" is kind of vague ;)

using System;
using System.IO;
using System.Diagnostics;

namespace MemSnap
{
class MemSnap
{
[STAThread]
static void Main(string[] args)
{
string activeDir = @"C:\MemSnap\Logs";
string memsnapDir = @"C:\Program Files\Support Tools\Memsnap.exe";
DateTime date = DateTime.Now;
string folder = Path.Combine(activeDir,
date.ToString("yyyy-MM-dd"));
string file = Path.Combine(folder, date.ToString("HH-mm-ss") +
".log");

// No need to check the existance as this will create a new folder
// if one doesn't already exist
Directory.CreateDirectory(folder);

try
{
Process.Start(memsnapDir, "/m " + file);
}
catch (Exception e2)
{
Console.WriteLine(e2.Message, e2.StackTrace.ToString());
}
}
}
}


--
Happy Coding!
Morten Wennevik [C# MVP]


J. Hwang said:
Hello Morten,

Thank you very much for your respond & helps.

I've tried as your advice.
I was be able to create the subfolder, but I still can't make the
memsanp to work as it should.

To my understanding, MemSnap is a Windows Server application which
will create a memory snap to a log file.
I just don't know what I'm missing, please help me again & let me know
what I'm doing wrong.

Here is my C# codes:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MemSnap
{
class MemSnap
{
static void Main(string[] args)
{
string activeDir = @"C:\MemSnap\Logs";
DateTime date = DateTime.Now;
string folder = date.ToString("yyyy-MM-dd");
string file = date.ToString("HH-mm-ss");
string newDir = System.IO.Path.Combine(activeDir, folder);

if (System.IO.Directory.Exists(newDir))
{
try
{
System.Diagnostics.Process.Start(@"C:\Program Files
\Support Tools\memsnap", @"-m C:\MemSnap\Logs\" + folder + @"\MemSnap"
+ file + ".log");
}
catch (Exception e1)
{
Console.WriteLine(e1.Message,
e1.StackTrace.ToString());
}
}
else
{
System.IO.Directory.CreateDirectory(newDir);

try
{
System.Diagnostics.Process.Start(@"C:\Program Files
\Support Tools\memsnap", @"-m C:\MemSnap\Logs\" + folder + @"\MemSnap"
+ file + ".log");
}
catch (Exception e2)
{
Console.WriteLine(e2.Message,
e2.StackTrace.ToString());
}
}
}
}
}

Thank you again in advance!
JH



Hi Hwang,

The following code will create a folder with a date stamp using the
Directory class and start the memsnap program using the Process class.

To get the time stamp you can use the DateTime.Now property which you can
output in any way you want using the time and date formatting codes. HH will
output the time in the 24 hour system. Use hh if you want a 12 hour system
instead. For more information check this page

[Custom Date and Time Format Strings]http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx

[C#]
DateTime date = DateTime.Now;

string folder = date.ToString("yyyy-MM-dd");
string file = date.ToString("HH-mm-ss");

Directory.CreateDirectory(folder);

Process.Start(@"C:\Program Files\Support Tools\memsnap",
@"-m C:\MemSnap\Logs\" + folder + @"\MemSnap" + file + ".log");

--
Happy Coding!
Morten Wennevik [C# MVP]



J. Hwang said:
I have a client which like me to convert their existing patch to c#
console application.
I know that it should be really simple, but I'm a newbee to C#.
I also knowing how to create a subfolder with the datestamp as the
code below,
but I don't know how to do the rest.
Please help me to convert these Patch code to c# console application.
@echo off
set dd=%date:~7,2%
set mm=%date:~4,2%
set yyyy=%date:~10,4%
set folder=%yyyy%-%mm%-%dd%
set hh=%time:~0,2%
set mm=%time:~3,2%
set ss=%time:~6,2%
set file=%hh%-%mm%-%ss%
if exist "C:\MemSnap\Logs\%folder%" (
"C:\Program Files\Support Tools\memsnap" -m "C:\MemSnap\Logs\%folder%
\MemSnap%file%.log"
) else (
mkdir "C:\MemSnap\Logs\%folder%"
"C:\Program Files\Support Tools\memsnap" -m "C:\MemSnap\Logs\%folder%
\MemSnap%file%.log"
)
Thank you very much in advance!- Hide quoted text -

- Show quoted text -
 
J

J. Hwang

Hello Morten,

Once again, thank you very much for your continue supports & helps.
Sorry for not given you the full detail of what memsnap should do.

My client is having some kind of memory leak on one of their Windows
2003 server which will cause the server to freezed up when it's out of
memory.
They have their it tech to create a batch file to do a memory snap
shot every hour.
Their IT tech installed the memsnap from their Windows server 2003
media.
It then created a folder "C:\Program Files\Support Tools\"
In side of this folder, it contain all the additional tools from
Microsoft for Windows server 2003 & XP used.

MemSnap is an application which will capture the whole current running
memory process & output them into a log file, that's where the "-m"
argument use for.

However, I've copied your code & override my existing & tested it.
It's still not working.
It created the folder, but is not creating the log.
I also tested with the change of the argument format from "/m " to "/-
m ", then to "-m ".
This still nothing happen other than created the folder.

I also agree that I don't need to check if the folder is exists or
not, but because that's what the client wants.
So I just did it anyway. :)

Please advice what else I should do.

By the way, what is this "[STAThread]" for if you don't mind to make
me understand?

Thank you!
JH


Hi,

I rewrote your sample slightly.  See if that works.  I don't have access to
memsnap here so I can't verify that the code works, though.  For future
reference, it helps if you provide some detail around the problem as "memsnap
does not work as it should" is kind of vague ;)

using System;
using System.IO;
using System.Diagnostics;

namespace MemSnap
{
    class MemSnap
    {
        [STAThread]
        static void Main(string[] args)
        {
            string activeDir = @"C:\MemSnap\Logs";
            string memsnapDir = @"C:\Program Files\Support Tools\Memsnap.exe";
            DateTime date = DateTime.Now;
            string folder = Path.Combine(activeDir,
date.ToString("yyyy-MM-dd"));
            string file = Path.Combine(folder, date.ToString("HH-mm-ss") +
".log");

            // No need to check the existance as this will create a new folder
            // if one doesn't already exist
            Directory.CreateDirectory(folder);

            try
            {
                Process.Start(memsnapDir, "/m " + file);
            }
            catch (Exception e2)
            {
                Console.WriteLine(e2.Message, e2.StackTrace.ToString());
            }
        }
    }

}

--
Happy Coding!
Morten Wennevik [C# MVP]



J. Hwang said:
Hello Morten,
Thank you very much for your respond & helps.
I've tried as your advice.
I was be able to create the subfolder, but I still can't make the
memsanp to work as it should.
To my understanding, MemSnap is a Windows Server application which
will create a memory snap to a log file.
I just don't know what I'm missing, please help me again & let me know
what I'm doing wrong.
Here is my C# codes:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace MemSnap
{
    class MemSnap
    {
        static void Main(string[] args)
        {
            string activeDir = @"C:\MemSnap\Logs";
            DateTime date = DateTime.Now;
            string folder = date.ToString("yyyy-MM-dd");
            string file = date.ToString("HH-mm-ss");
            string newDir = System.IO.Path.Combine(activeDir, folder);
            if (System.IO.Directory.Exists(newDir))
            {
                try
                {
                    System.Diagnostics.Process.Start(@"C:\Program Files
\Support Tools\memsnap", @"-m C:\MemSnap\Logs\" + folder + @"\MemSnap"
+ file + ".log");
                }
                catch (Exception e1)
                {
                    Console.WriteLine(e1.Message,
e1.StackTrace.ToString());
                }
            }
            else
            {
                System.IO.Directory.CreateDirectory(newDir);
                try
                {
                    System.Diagnostics.Process.Start(@"C:\Program Files
\Support Tools\memsnap", @"-m C:\MemSnap\Logs\" + folder + @"\MemSnap"
+ file + ".log");
                }
                catch (Exception e2)
                {
                    Console.WriteLine(e2.Message,
e2.StackTrace.ToString());
                }
            }
        }
    }
}
Thank you again in advance!
JH
Hi Hwang,
The following code will create a folder with a date stamp using the
Directory class  and start the memsnap program using the Process class.
To get the time stamp you can use the DateTime.Now property which youcan
output in any way you want using the time and date formatting codes.  HH will
output the time in the 24 hour system.  Use hh if you want a 12 hour system
instead.  For more information check this page
[Custom Date and Time Format Strings]http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx
[C#]
DateTime date = DateTime.Now;
string folder = date.ToString("yyyy-MM-dd");
string file = date.ToString("HH-mm-ss");
Directory.CreateDirectory(folder);
Process.Start(@"C:\Program Files\Support Tools\memsnap",
    @"-m C:\MemSnap\Logs\" + folder + @"\MemSnap" + file + ".log");
--
Happy Coding!
Morten Wennevik [C# MVP]
:
Hello,
I have a client which like me to convert their existing patch to c#
console application.
I know that it should be really simple, but I'm a newbee to C#.
I also knowing how to create a subfolder with the datestamp as the
code below,
but I don't know how to do the rest.
Please help me to convert these Patch code to c# console application.
@echo off
set dd=%date:~7,2%
set mm=%date:~4,2%
set yyyy=%date:~10,4%
set folder=%yyyy%-%mm%-%dd%
set hh=%time:~0,2%
set mm=%time:~3,2%
set ss=%time:~6,2%
set file=%hh%-%mm%-%ss%
if exist "C:\MemSnap\Logs\%folder%" (
"C:\Program Files\Support Tools\memsnap" -m "C:\MemSnap\Logs\%folder%
\MemSnap%file%.log"
) else (
mkdir "C:\MemSnap\Logs\%folder%"
"C:\Program Files\Support Tools\memsnap" -m "C:\MemSnap\Logs\%folder%
\MemSnap%file%.log"
)
Thank you very much in advance!- Hide quoted text -
- Show quoted text -- Hide quoted text -

- Show quoted text -
 
J

J. Hwang

Hello Morten,

Never mind about my previouse reply.
I must of did something funny on my 1st copy of your rewrote code.
I re-copied it again & it's working great.

Once again, thank you very much for all your helps & supports.

Cheers!
JH


Hi,

I rewrote your sample slightly.  See if that works.  I don't have access to
memsnap here so I can't verify that the code works, though.  For future
reference, it helps if you provide some detail around the problem as "memsnap
does not work as it should" is kind of vague ;)

using System;
using System.IO;
using System.Diagnostics;

namespace MemSnap
{
    class MemSnap
    {
        [STAThread]
        static void Main(string[] args)
        {
            string activeDir = @"C:\MemSnap\Logs";
            string memsnapDir = @"C:\Program Files\Support Tools\Memsnap.exe";
            DateTime date = DateTime.Now;
            string folder = Path.Combine(activeDir,
date.ToString("yyyy-MM-dd"));
            string file = Path.Combine(folder, date.ToString("HH-mm-ss") +
".log");

            // No need to check the existance as this will create a new folder
            // if one doesn't already exist
            Directory.CreateDirectory(folder);

            try
            {
                Process.Start(memsnapDir, "/m " + file);
            }
            catch (Exception e2)
            {
                Console.WriteLine(e2.Message, e2.StackTrace.ToString());
            }
        }
    }

}

--
Happy Coding!
Morten Wennevik [C# MVP]



J. Hwang said:
Hello Morten,
Thank you very much for your respond & helps.
I've tried as your advice.
I was be able to create the subfolder, but I still can't make the
memsanp to work as it should.
To my understanding, MemSnap is a Windows Server application which
will create a memory snap to a log file.
I just don't know what I'm missing, please help me again & let me know
what I'm doing wrong.
Here is my C# codes:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace MemSnap
{
    class MemSnap
    {
        static void Main(string[] args)
        {
            string activeDir = @"C:\MemSnap\Logs";
            DateTime date = DateTime.Now;
            string folder = date.ToString("yyyy-MM-dd");
            string file = date.ToString("HH-mm-ss");
            string newDir = System.IO.Path.Combine(activeDir, folder);
            if (System.IO.Directory.Exists(newDir))
            {
                try
                {
                    System.Diagnostics.Process.Start(@"C:\Program Files
\Support Tools\memsnap", @"-m C:\MemSnap\Logs\" + folder + @"\MemSnap"
+ file + ".log");
                }
                catch (Exception e1)
                {
                    Console.WriteLine(e1.Message,
e1.StackTrace.ToString());
                }
            }
            else
            {
                System.IO.Directory.CreateDirectory(newDir);
                try
                {
                    System.Diagnostics.Process.Start(@"C:\Program Files
\Support Tools\memsnap", @"-m C:\MemSnap\Logs\" + folder + @"\MemSnap"
+ file + ".log");
                }
                catch (Exception e2)
                {
                    Console.WriteLine(e2.Message,
e2.StackTrace.ToString());
                }
            }
        }
    }
}
Thank you again in advance!
JH
Hi Hwang,
The following code will create a folder with a date stamp using the
Directory class  and start the memsnap program using the Process class.
To get the time stamp you can use the DateTime.Now property which youcan
output in any way you want using the time and date formatting codes.  HH will
output the time in the 24 hour system.  Use hh if you want a 12 hour system
instead.  For more information check this page
[Custom Date and Time Format Strings]http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx
[C#]
DateTime date = DateTime.Now;
string folder = date.ToString("yyyy-MM-dd");
string file = date.ToString("HH-mm-ss");
Directory.CreateDirectory(folder);
Process.Start(@"C:\Program Files\Support Tools\memsnap",
    @"-m C:\MemSnap\Logs\" + folder + @"\MemSnap" + file + ".log");
--
Happy Coding!
Morten Wennevik [C# MVP]
:
Hello,
I have a client which like me to convert their existing patch to c#
console application.
I know that it should be really simple, but I'm a newbee to C#.
I also knowing how to create a subfolder with the datestamp as the
code below,
but I don't know how to do the rest.
Please help me to convert these Patch code to c# console application.
@echo off
set dd=%date:~7,2%
set mm=%date:~4,2%
set yyyy=%date:~10,4%
set folder=%yyyy%-%mm%-%dd%
set hh=%time:~0,2%
set mm=%time:~3,2%
set ss=%time:~6,2%
set file=%hh%-%mm%-%ss%
if exist "C:\MemSnap\Logs\%folder%" (
"C:\Program Files\Support Tools\memsnap" -m "C:\MemSnap\Logs\%folder%
\MemSnap%file%.log"
) else (
mkdir "C:\MemSnap\Logs\%folder%"
"C:\Program Files\Support Tools\memsnap" -m "C:\MemSnap\Logs\%folder%
\MemSnap%file%.log"
)
Thank you very much in advance!- Hide quoted text -
- Show quoted text -- Hide quoted text -

- Show quoted text -
 
M

Morten Wennevik [C# MVP]

Hi,

Glad to hear you solved the problem. STAThread (Single Threaded Apartment
Thread) is a COM thread-model attribute used if your application uses COM
Components. In this case it is more or less meaningless as you don't use
COM, but STAThread is default (as opposed to MTAThread) and it couldn't hurt
to try :)

--
Happy Coding!
Morten Wennevik [C# MVP]


J. Hwang said:
Hello Morten,

Never mind about my previouse reply.
I must of did something funny on my 1st copy of your rewrote code.
I re-copied it again & it's working great.

Once again, thank you very much for all your helps & supports.

Cheers!
JH


Hi,

I rewrote your sample slightly. See if that works. I don't have access to
memsnap here so I can't verify that the code works, though. For future
reference, it helps if you provide some detail around the problem as "memsnap
does not work as it should" is kind of vague ;)

using System;
using System.IO;
using System.Diagnostics;

namespace MemSnap
{
class MemSnap
{
[STAThread]
static void Main(string[] args)
{
string activeDir = @"C:\MemSnap\Logs";
string memsnapDir = @"C:\Program Files\Support Tools\Memsnap.exe";
DateTime date = DateTime.Now;
string folder = Path.Combine(activeDir,
date.ToString("yyyy-MM-dd"));
string file = Path.Combine(folder, date.ToString("HH-mm-ss") +
".log");

// No need to check the existance as this will create a new folder
// if one doesn't already exist
Directory.CreateDirectory(folder);

try
{
Process.Start(memsnapDir, "/m " + file);
}
catch (Exception e2)
{
Console.WriteLine(e2.Message, e2.StackTrace.ToString());
}
}
}

}

--
Happy Coding!
Morten Wennevik [C# MVP]



J. Hwang said:
Hello Morten,
Thank you very much for your respond & helps.
I've tried as your advice.
I was be able to create the subfolder, but I still can't make the
memsanp to work as it should.
To my understanding, MemSnap is a Windows Server application which
will create a memory snap to a log file.
I just don't know what I'm missing, please help me again & let me know
what I'm doing wrong.
Here is my C# codes:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace MemSnap
{
class MemSnap
{
static void Main(string[] args)
{
string activeDir = @"C:\MemSnap\Logs";
DateTime date = DateTime.Now;
string folder = date.ToString("yyyy-MM-dd");
string file = date.ToString("HH-mm-ss");
string newDir = System.IO.Path.Combine(activeDir, folder);
if (System.IO.Directory.Exists(newDir))
{
try
{
System.Diagnostics.Process.Start(@"C:\Program Files
\Support Tools\memsnap", @"-m C:\MemSnap\Logs\" + folder + @"\MemSnap"
+ file + ".log");
}
catch (Exception e1)
{
Console.WriteLine(e1.Message,
e1.StackTrace.ToString());
}
}
else
{
System.IO.Directory.CreateDirectory(newDir);
try
{
System.Diagnostics.Process.Start(@"C:\Program Files
\Support Tools\memsnap", @"-m C:\MemSnap\Logs\" + folder + @"\MemSnap"
+ file + ".log");
}
catch (Exception e2)
{
Console.WriteLine(e2.Message,
e2.StackTrace.ToString());
}
}
}
}
}
Thank you again in advance!
JH
On Jun 17, 12:44 am, Morten Wennevik [C# MVP]
Hi Hwang,
The following code will create a folder with a date stamp using the
Directory class and start the memsnap program using the Process class.
To get the time stamp you can use the DateTime.Now property which you can
output in any way you want using the time and date formatting codes. HH will
output the time in the 24 hour system. Use hh if you want a 12 hour system
instead. For more information check this page
[C#]
DateTime date = DateTime.Now;
string folder = date.ToString("yyyy-MM-dd");
string file = date.ToString("HH-mm-ss");

Process.Start(@"C:\Program Files\Support Tools\memsnap",
@"-m C:\MemSnap\Logs\" + folder + @"\MemSnap" + file + ".log");
I have a client which like me to convert their existing patch to c#
console application.
I know that it should be really simple, but I'm a newbee to C#.
I also knowing how to create a subfolder with the datestamp as the
code below,
but I don't know how to do the rest.
Please help me to convert these Patch code to c# console application.
@echo off
set dd=%date:~7,2%
set mm=%date:~4,2%
set yyyy=%date:~10,4%
set folder=%yyyy%-%mm%-%dd%
set hh=%time:~0,2%
set mm=%time:~3,2%
set ss=%time:~6,2%
set file=%hh%-%mm%-%ss%
if exist "C:\MemSnap\Logs\%folder%" (
"C:\Program Files\Support Tools\memsnap" -m "C:\MemSnap\Logs\%folder%
\MemSnap%file%.log"
) else (
mkdir "C:\MemSnap\Logs\%folder%"
"C:\Program Files\Support Tools\memsnap" -m "C:\MemSnap\Logs\%folder%
\MemSnap%file%.log"
)
Thank you very much in advance!- Hide quoted text -
- Show quoted text -- Hide quoted text -

- Show quoted text -
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top