@echo off dir /ad /b /o:g C:\> C:\フォルダ.txt echo 終了しました。 |
@echo off dir /a-d /b C:\> C:\ファイル.txt |
@echo off perl shusei_folder.pl perl shusei_file.pl |
#!/usr/bin/perl use strict; use warnings; sub trim { my $val = shift; $val =~ s/^ *(.*?) *$/$1/; return $val; } my $bun; my @file2; my $line2; open(FILE,'C:\フォルダ.txt') or die "$!"; my @file=<FILE>; close(FILE); push(@file2,"\@echo off\n"); foreach my $line(@file){ chomp($line); if($line=~/./){ $line2=trim($line); if($line ne "JUST" and $line ne "WINDOWS" and $line ne "Program Files"){ $bun="xcopy /D /I /S /Y C:\\".$line2." \\\\Hp\\shareddocs\\".$line2."\\ \n"; push(@file2,$bun); } } } open(NEWFILE, '>C:\file_ido.bat') or die "$!"; print NEWFILE @file2; close(NEWFILE); |
#!/usr/bin/perl use strict; use warnings; sub trim { my $val = shift; $val =~ s/^ *(.*?) *$/$1/; return $val; } my $bun; my @file2; my $line2; open(FILE,'C:\ファイル.txt') or die "$!"; my @file=<FILE>; close(FILE); foreach my $line(@file){ chomp($line); if($line=~/./){ $line2=trim($line); $bun="echo F | xcopy /D /Y C:\\".$line2." \\\\Hp\\shareddocs\\".$line2."\n"; push(@file2,$bun); } } push(@file2,"echo 終了しました。\n"); open(NEWFILE, '>>C:\file_ido.bat') or die "$!"; print NEWFILE @file2; close(NEWFILE); |
@echo off perl shusei_folder_back.pl perl shusei_file_back.pl echo 終了しました。 |
#!/usr/bin/perl use strict; use warnings; sub trim { my $val = shift; $val =~ s/^ *(.*?) *$/$1/; return $val; } my $bun; my @file2; my $line2; open(FILE,'C:\フォルダ.txt') or die "$!"; my @file=<FILE>; close(FILE); push(@file2,"\@echo off\n"); foreach my $line(@file){ chomp($line); if($line=~/./){ $line2=trim($line); if($line ne "JUST" and $line ne "WINDOWS" and $line ne "Program Files"){ $bun="xcopy /D /I /S /Y \\\\Hp\\shareddocs\\".$line2." C:\\".$line2. "\\\n"; push(@file2,$bun); } } } open(NEWFILE, '>C:\file_back.bat') or die "$!"; print NEWFILE @file2; close(NEWFILE); |
#!/usr/bin/perl use strict; use warnings; sub trim { my $val = shift; $val =~ s/^ *(.*?) *$/$1/; return $val; } my $bun; my @file2; my $line2; open(FILE,'C:\ファイル.txt') or die "$!"; my @file=<FILE>; close(FILE); foreach my $line(@file){ chomp($line); if($line=~/./){ $line2=trim($line); $bun="echo F | xcopy /D /Y \\\\Hp\\shareddocs\\".$line2." C:\\".$line2."\n"; push(@file2,$bun); } } push(@file2,"echo 終了しました。\n"); open(NEWFILE, '>>C:\file_back.bat') or die "$!"; print NEWFILE @file2; close(NEWFILE); |
@echo off xcopy /D /I /S /Y \\HP\shareddocs\Shiken C:\Shiken\ echo F | xcopy /D /Y \\HP\shareddocs\test.txt C:\test.txt echo 終了しました。 |
@echo off dir /ad /b /o:g C:\> C:\フォルダ.txt echo 終了しました。 |
@echo off dir /a-d /b C:\> C:\ファイル.txt |
@echo off perl shusei_folder.pl perl shusei_file.pl |
#!/usr/bin/perl use strict; use warnings; sub trim { my $val = shift; $val =~ s/^ *(.*?) *$/$1/; return $val; } my $bun; my @file2; my $line2; open(FILE,'C:\フォルダ.txt') or die "$!"; my @file=<FILE>; close(FILE); push(@file2,"\@echo off\n"); foreach my $line(@file){ chomp($line); if($line=~/./){ $line2=trim($line); if($line ne "JUST" and $line ne "WINDOWS" and $line ne "Program Files"){ $bun="xcopy /D /I /S /Y C:\\".$line2." \\\\Hp\\shareddocs\\".$line2."\\ \n"; push(@file2,$bun); } } } open(NEWFILE, '>C:\file_ido.bat') or die "$!"; print NEWFILE @file2; close(NEWFILE); |
#!/usr/bin/perl use strict; use warnings; sub trim { my $val = shift; $val =~ s/^ *(.*?) *$/$1/; return $val; } my $bun; my @file2; my $line2; open(FILE,'C:\ファイル.txt') or die "$!"; my @file=<FILE>; close(FILE); foreach my $line(@file){ chomp($line); if($line=~/./){ $line2=trim($line); $bun="echo F | xcopy /D /Y C:\\".$line2." \\\\Hp\\shareddocs\\".$line2."\n"; push(@file2,$bun); } } push(@file2,"echo 終了しました。\n"); open(NEWFILE, '>>C:\file_ido.bat') or die "$!"; print NEWFILE @file2; close(NEWFILE); |
@echo off perl shusei_folder_back.pl perl shusei_file_back.pl echo 終了しました。 |
#!/usr/bin/perl use strict; use warnings; sub trim { my $val = shift; $val =~ s/^ *(.*?) *$/$1/; return $val; } my $bun; my @file2; my $line2; open(FILE,'C:\フォルダ.txt') or die "$!"; my @file=<FILE>; close(FILE); push(@file2,"\@echo off\n"); foreach my $line(@file){ chomp($line); if($line=~/./){ $line2=trim($line); if($line ne "JUST" and $line ne "WINDOWS" and $line ne "Program Files"){ $bun="xcopy /D /I /S /Y \\\\Hp\\shareddocs\\".$line2." C:\\".$line2. "\\\n"; push(@file2,$bun); } } } open(NEWFILE, '>C:\file_back.bat') or die "$!"; print NEWFILE @file2; close(NEWFILE); |
#!/usr/bin/perl use strict; use warnings; sub trim { my $val = shift; $val =~ s/^ *(.*?) *$/$1/; return $val; } my $bun; my @file2; my $line2; open(FILE,'C:\ファイル.txt') or die "$!"; my @file=<FILE>; close(FILE); foreach my $line(@file){ chomp($line); if($line=~/./){ $line2=trim($line); $bun="echo F | xcopy /D /Y \\\\Hp\\shareddocs\\".$line2." C:\\".$line2."\n"; push(@file2,$bun); } } push(@file2,"echo 終了しました。\n"); open(NEWFILE, '>>C:\file_back.bat') or die "$!"; print NEWFILE @file2; close(NEWFILE); |
idomoto_folder idomoto_file ido_command_sakusei file_ido |
back_command_sakusei file_back |
@file=<FILE>; dir /ad /b /o:g \\Hope\SharedDocs\> C:\フォルダ.txt echo 終了しました。 |
@echo off dir /a-d /b \\Hope\SharedDocs\> C:\ファイル.txt echo 終了しました。 |
%SystemRoot%\system32\cmd.exe /k C:\henko.bat |
@echo off cd c:\ doskey /macrofile=C:\macros.txt |
word="C:\Program Files\Microsoft Office\Office\WINWORD.EXE" $* sakura="C:\Program Files\sakura\sakura.exe" $* firefox="C:\Program Files\Mozilla Firefox\firefox.exe" $* |
@echo off dir /ad /b C:\"Documents and Settings"\"All Users"\Documents\> C:\Shareフォルダ.txt echo 終了しました。 |
@echo off dir /a-d /b C:\"Documents and Settings"\"All Users"\Documents\> C:\Shareファイル.txt echo 終了しました。 |
#!/usr/bin/perl use strict; use warnings; sub trim { my $val = shift; $val =~ s/^ *(.*?) *$/$1/; return $val; } my $bun; my @file2; my $line2; open(FILE,'C:\Shareフォルダ.txt') or die "$!"; @file=<FILE>; close(FILE); push(@file2,"\@echo off\n"); foreach my $line(@file){ chomp($line); if($line=~/./){ $line2=trim($line); if($line ne "JUST" and $line ne "WINDOWS" and $line ne "Program Files"){ $bun="xcopy /D /I /S /Y C:\\\"Documents and Settings\"\\\"All Users\"\\Documents\\".$line2." C:\\Backup1\\".$line2."\\ \n"; push(@file2,$bun); } } } open(NEWFILE, '>C:\folder_copy.bat') or die "$!"; print NEWFILE @file2; close(NEWFILE); |
#!/usr/bin/perl use strict; use warnings; sub trim { my $val = shift; $val =~ s/^ *(.*?) *$/$1/; return $val; } my $bun; my @file2; my $line2; open(FILE,'C:\Shareファイル.txt') or die "$!"; @file=<FILE>; close(FILE); foreach my $line(@file){ chomp($line); if($line=~/./){ $line2=trim($line); $bun="echo F | xcopy /D /Y C:\\\"Documents and Settings\"\\\"All Users\"\\Documents\\".$line2." C:\\Backup1\\".$line2."\n"; push(@file2,$bun); } } push(@file2,"echo 終了しfile_ichiran_sakusei.batました。\n"); open(NEWFILE, '>C:\file_copy.bat') or die "$!"; print NEWFILE @file2; close(NEWFILE); |
@echo off folder_ichiran_sakusei file_ichiran_sakusei.bat perl folder_copy_sakusei.pl perl file_copy_sakusei.pl |