ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

VBA ½Æ»sÀɮרì¥t¤@¥x¹q¸£

VBA ½Æ»sÀɮרì¥t¤@¥x¹q¸£

½Ð°Ý

F = "C:\test.txt"

F2 = "\\192.168.1.1\text\"

Set fs = CreateObject("Scripting.FileSystemObject")
     fs.CopyFile F, F2
Set fs = Nothing

¦¹®É·|¥X²{Åv­­¤£¨¬¡A­ì¦]¬°°Ïºô»Ý­n±b¸¹±K½Xµn¤J¡C

½Ð°Ý§Ú¦p¦óª½±µµ¹»P±b¸¹±K½X¡A¨ÏÀÉ®×¥i¥H¶¶§Q½Æ»s¹L¥h?

¦^´_ 1# warhead


    vba§PÂ_¬O§_¤wµn¤Jºô­¶
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 2# GBKEE

G¤j±z´£¨Ñªº¬Oºô­¶ªºµn¤J¤è¦¡¡A¬Ý°_¨Ó¦n¹³¬O¥h§äinputªºÄæ¦ì¶ñ¤W¡A

§Ú¬O§Q¥ÎºôªÚ­n§âÀÉ®×¥á¨ì¥t¤@¥x¹q¸£­ù¡A¥Lª½±µ¸õ¥XÅv­­¤£¨¬¡A

¨S¦³¥X²{§Ú¥i¥H¿é¤J±K½Xªº¦a¤è¡A©Ò¥HºN¤£µÛÀYºü­n±q¦ó¤U¤â¡C

TOP

https://stackoverflow.com/questions/631401/access-network-share-from-within-vbscript-eg-filesystemobject

¸Õ¸Õ¬Ý¯à¤£¯à¦¨

TOP

¦^´_ 4# jackyq

J¤j¡A¦b¬õ¦â¨º¤@¦æ·|¥X²{§ä¤£¨ì¸ô®|¡A
¦ý§Úª½±µ±qÀÉ®×Á`ºÞªº¦a¤èµ¹\\192.168.1.1 ·|¥X²{­n§Ú¿é¤J±b¸¹±K½X¡A³o¼Ë¥Nªí¸ô®|À³¸Ó¨S°ÝÃD¹ï§a?

Dim Directory as Object
ServerShare = "\\192.168.1.1\test"
UserName = "test"
Password = "test"

Set NetworkObject = CreateObject("WScript.Network")
Set FSO = CreateObject("Scripting.FileSystemObject")

NetworkObject.MapNetworkDrive "", ServerShare, False, UserName, Password

Set Directory = FSO.GetFolder(ServerShare)
For Each FileName In Directory.Files
    WScript.Echo FileName.Name
Next

Set FileName = Nothing
Set Directory = Nothing
Set FSO = Nothing

NetworkObject.RemoveNetworkDrive ServerShare, True, False

Set ShellObject = Nothing
Set NetworkObject = Nothing

TOP

§Ú¥Î¦Û¤v¹q¸£ ³s½u ¦Û¤v¹q¸£´ú¸Õ
¨BÆJ¦p¤U

(1)
¤U­±ºô§}¥u¬Ý 8 ,9 ,10 ³o3¦U¨BÆJ ( ¦]¬°§Ú¥u³s¦Û¤v¹q¸£ )
http://system.cyut.edu.tw/tech/share1/share.html

§Ú³]©w¤À¨É¤å¥ó§¨¦WºÙ = QQ

(2)
¥´¶} ©R¥O´£¥Ü -> ¥´¤J IPconfig -> §ä¨ì °Ï°ì³s½uxx

°Ï°ì³s½uxx  ¤À¤ä¤U¦³­Ó IP Address , ³o­Ó¤~¬O¹q¸£ªº IP

¹³§Úªº = \\192.168.1.104


'==========================

ServerShare = "\\192.168.1.104\QQ"
UserName = ""
Password = ""

Set NetworkObject = CreateObject("WScript.Network")
     NetworkObject.MapNetworkDrive "", ServerShare, False, UserName, Password   '³s½u¦¨¥\

TOP

¦^´_ 6# jackyq


J¤j¡A¨Ï¥Î§Aªº¤è¦¡¦b¦Û¤v¹q¸£´ú¸Õ¦¨¥\¡A¦b¦^¨ì°Ïºô¤W´ú¸Õ¡Aµo²{¦b¬O¸ê®Æ§¨¦@¥Î¨S³]©w¦n

¦A¦¸·PÁ±zªºÀ°¦£¡AÁÂÁÂ

TOP

¶}­Ó°O¨Æ¥»
¿é¤J¥H¤Uµ{¦¡½X
¦s¦¨XXXX.bat

@echo on

net use x: \\BBB\AAA
XCOPY "x:\" D:\CCCC\ /E /C /Q /Y
net use x: /delete
pause

µ{¦¡»¡©ú
±N¥N¸¹X ¬° °Ïºô¤ºªºBBB¹q¸£¤ºªº AAA¸ê®Æ(»Ý¥ý¶}¦@¨É) ºÏºÐ¾÷

±NAAA¸ê®Æ§¨ ½Æ»s¨ì D¼Ñ¤º CCCC ªº¸ê®Æ§¨¤º (°Ñ¼Æ½Ð¦Û¦æ¬d¸ß)
§âXºÏºÐ¾÷§R°£

  ¦h°µ¦h·Q¦h¾Ç²ß¡A¤Ö¬Ý¤Ö¿ù¤Ö°g³~

  ¦h°µ=¦h¦h½m²ß¡A¦h¦h½s¼g¡C
  ¦h·Q=·Q·Q¬°¤°»ò¤H®aµ{¦¡­n¨º¼Ë¼g¡A¦pªG´«¦¨¦Û¤v¡A¤S·|«ç¼g¡C
  ¦h¾Ç²ß=¾Ç²ß¤H®aªºµo°Ý¨Ã¸Ñµª¡A¾Ç²ß¤H®aªº¼gªk

  ¤Ö¬Ý=¥u¬Ý¤£°µ¤]ªPµM

TOP

        ÀR«ä¦Û¦b : ¦¨¥\¬OÀuÂIªºµo´§¡A¥¢±Ñ¬O¯ÊÂIªº²Ö¿n¡C
ªð¦^¦Cªí ¤W¤@¥DÃD