Ask Your Question

How to create folder name with current date and time in windows 8 machine using puppet?

asked 2016-03-29 05:01:50 -0600

yoga gravatar image

I am using Windows 8 machine as agent.I want to create backup folder having the name of current date and time.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2016-04-05 23:22:51 -0600

yoga gravatar image

The code below i attached create directory name with current date and time in windows machine.

      exec{"conf folder":
      command=>'C:\Windows\System32\cmd.exe /c "md %date:~7,2%-%date:~-10,2%-%date:~-4,4%--%TIME:~0,2%_%TIME:~3,2%_%TIME:~6,2%"',
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2016-03-29 05:01:50 -0600

Seen: 276 times

Last updated: Apr 05 '16