#30870 - 2002-10-17 07:33 PM
Confused About Logic (COPY by variables doesn't work. FIX paths ok)
|
Justin Emlay
Fresh Scripter
Registered: 2002-05-24
Posts: 26
|
When I perform this script the Target DIR gets filled with the contents from the users Windows DIR???
If InGroup("SYSTEMS") $Target='C:\Target Folder\' $Source='\\file\data\SAPB\SAPB.MDB' Copy 'Source' 'Target'
However when I hard code the Target and Source DIRs it works fine:
If InGroup("SYSTEMS") $Target='C:\Target Folder\' $Source='\\file\data\SAPB\SAPB.MDB' Copy '\\file\data\SAPB\SAPB.MDB' 'C:\Target Folder\'
Am I using the copy function incorrectly? I'm using it just as the examples state.
Thanks
(MCA: extend subject) [ 07. December 2002, 12:09: Message edited by: MCA ]
|
|
Top
|
|
|
|
#30873 - 2002-10-17 07:42 PM
Re: Confused About Logic (COPY by variables doesn't work. FIX paths ok)
|
Justin Emlay
Fresh Scripter
Registered: 2002-05-24
Posts: 26
|
I forgot to revert my code back from hardcoding it. Lets try this again:
When I perform this script the Target DIR gets filled with the contents from the users Windows DIR???
If InGroup("SYSTEMS") $Target='C:\Target Folder\' $Source='\\file\data\SAPB\SAPB.MDB' Copy $Source $Target
However when I hard code the Target and Source DIRs it works fine:
If InGroup("SYSTEMS") $Target='C:\Target Folder\' $Source='\\file\data\SAPB\SAPB.MDB' Copy '\\file\data\SAPB\SAPB.MDB' 'C:\Target Folder\'
Thanks
|
|
Top
|
|
|
|
#30875 - 2002-10-17 07:56 PM
Re: Confused About Logic (COPY by variables doesn't work. FIX paths ok)
|
Justin Emlay
Fresh Scripter
Registered: 2002-05-24
Posts: 26
|
Full Code:
CLS
Big $X = 1 Do Color w/n AT ( $X,$X*3 ) "MAISTO" $X = $X+1 Until $X = 6 Color g+/n AT ( $X,$X*3 ) "MAISTO" AT (23,0) Small
SetTime "\\FILE"
If (Exist("F:\.") = 1) Use F: /delete /persistent EndIf Use F: "\\file\data"
$DefaultUserIDKey = ReadValue("HKEY_CURRENT_USER\Identities", "Default User ID") $OESubKey="HKEY_CURRENT_USER\Identities\$DefaultUserIDKey\Software\Microsoft\Outlook Express\5.0" $OERegValue="\\mail\users$$\@USERID" $WABSubKey="HKEY_CURRENT_USER\SOFTWARE\MICROSOFT\WAB\WAB4\Wab File Name" $WABRegValue="\\mail\users$$\@USERID\@USERID.wab" $MyDocSubKey1="HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" $MyDocSubKey2="HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" $MyDocRegValue="\\FILE\USERS$$\@USERID" $NewIconKey="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Extensions\{24523867-0178-1422-5555-835448663557}" $NewIconValue="http://ww2.maisto.com/default.asp"
If (WriteValue($OESubKey,"Store Root",$OERegValue,"REG_SZ") <> 0) EndIf If (WriteValue($OESubKey,"SendMDN","1","REG_DWORD") <> 0) EndIf If (WriteValue($OESubKey,"SendReceiptToList","0","REG_DWORD") <> 0) EndIf If (WriteValue($WABSubKey,"",$WABRegValue,"REG_SZ") <> 0) EndIf If (WriteValue($MyDocSubKey1,"Personal",$MyDocRegValue,"REG_SZ") <> 0) EndIf If (WriteValue($MyDocSubKey2,"Personal",$MyDocRegValue,"REG_SZ") <> 0) EndIf If (WriteValue($NewIconKey,"exec",$NewIconValue,"REG_SZ") <> 0) EndIf
If InGroup("ORDER ENTRY") OR InGroup("SHIPPING") $Source='\\file\data\SAPB\SAPB.MDB' $Target='C:\MAISTO\' If Exist($Source) AND Exist($Target) Copy $Source $Target If @error EndIf EndIf EndIf
c:\maisto gets filled with the contents of the windows DIR (files only).
Thanks for the help
|
|
Top
|
|
|
|
#30877 - 2002-10-17 08:18 PM
Re: Confused About Logic (COPY by variables doesn't work. FIX paths ok)
|
Justin Emlay
Fresh Scripter
Registered: 2002-05-24
Posts: 26
|
"If (Exist("F:\.") = 1)" - I learned by example so thats what I used. I have now removed the 1 portion of the statement.
"anyway, could you check @curdir" - "? @curdir" returns "c:\windows"
"f:\sapb" - I used that first and switch to UNC when it wasn't working out for me. I might as well leave it as UNC since that file will be moving away from the F: map in short time.
|
|
Top
|
|
|
|
#30881 - 2002-10-17 08:55 PM
Re: Confused About Logic (COPY by variables doesn't work. FIX paths ok)
|
Justin Emlay
Fresh Scripter
Registered: 2002-05-24
Posts: 26
|
Lonkero: I'm sure there are many ways of doing just about everything. As I stated before I leanred from examples from this forum.
sealeopard: source = c:\windows destination = C:\MAISTO\
To add to the confusion. I have no problems on W2K, this is only happening on Win98 machines.
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
1 registered
(Allen)
and 905 anonymous users online.
|
|
|