指定ユーザで他のPCにログインしてファイルコピー

  コード



  
<HTML>
<HEAD>
<META
	http-equiv="Content-type"
	content="text/html; charset=Shift_JIS"
>
</HEAD>
<BODY>
<%

Response.Write "処理開始<br>"

Set WshShell = Server.CreateObject( "WScript.Shell" )
Set Basp = Server.CreateObject( "Basp21" )

strCommand = "net use z: \\PC名\copy パスワード /USER:ワークグループ\lightbox"

Call WshShell.Run( strCommand,, true )

strTarget = Server.MapPath( "aaa.txt" )

strCommand = "xcopy " & strTarget & " z:\"
Set objExec = WshShell.Exec( strCommand )

Do While objExec.Status = 0
	Basp.Sleep 1
Loop

Response.Write "<PRE>"

Do While not objExec.StdErr.AtEndOfStream
	Response.Write "エラー:" & objExec.StdErr.ReadAll
Loop
Do While not objExec.StdOut.AtEndOfStream
	Response.Write "正常:" & objExec.StdOut.ReadAll
Loop

Response.Write "</PRE>"

strCommand = "net use z: /DELETE"
Call WshShell.Run( strCommand,, true )

Response.Write "処理終了<br>"
%>
</BODY>
</HTML>
  












   SQLの窓    create:2005/05/28  update:2014/09/07   管理者用(要ログイン)





フリーフォントWEBサービス

SQLの窓WEBサービス

SQLの窓フリーソフト

写真素材

一般WEBツールリンク

SQLの窓

フリーソフト

JSライブラリ