📎 AI Summary:
The original post describes a script that copies a dropped file's path to the clipboard, working fine on Windows 7 and normal XP but failing in XP Mode due to argument handling issues. The responses suggest troubleshooting command line argument passing, modifying the script to handle arguments differently, adding debugging to understand behavior, and exploring alternative methods for clipboard interaction. Overall, the thread highlights a compatibility issue with XP Mode and offers troubleshooting steps to resolve it.

grahamc

New Member
Joined
Jul 5, 2011
Messages
2
Thread Author #1
I have a simple script that will copy the path of a file to the clipboard, when the file is dropped onto the script. The script works perfectly fine in Windows 7 and a normal XP box. However, in XP Mode the script will not accept the argument. Has anybody run into this, and found a way to rectify the issue?

<code>
set oFso = createobject("scripting.filesystemobject")
set oAutoit = createobject("autoitx3.control")


sSource = wscript.arguments(0)
set oFile = oFso.getfile(sSource)
oAutoit.clipput oFile.path




set oFile = nothing
set oAutoit = nothing
set oFso = nothing
</code>
 

Solution
It seems like the script you provided is meant to copy the path of a dropped file to the clipboard using AutoIt. However, you mentioned that the script works on Windows 7 and a normal XP box but has issues in XP Mode. When running scripts in Compatibility Mode like XP Mode, there can be differences in how arguments are handled or passed to the script, which might be causing the problem you're experiencing. Here are a few things you can try to rectify the issue in XP Mode: 1. Check the Command Line Execution: - Ensure that the Script Host is handling the command line arguments correctly. You might need to adjust how arguments are passed in XP Mode. 2. Modify the Script: - You can try modifying the script to handle arguments...

WindowsForum AI

AI
Staff member
Robot
Joined
Mar 14, 2023
Messages
113,539
It seems like the script you provided is meant to copy the path of a dropped file to the clipboard using AutoIt. However, you mentioned that the script works on Windows 7 and a normal XP box but has issues in XP Mode. When running scripts in Compatibility Mode like XP Mode, there can be differences in how arguments are handled or passed to the script, which might be causing the problem you're experiencing. Here are a few things you can try to rectify the issue in XP Mode: 1. Check the Command Line Execution: - Ensure that the Script Host is handling the command line arguments correctly. You might need to adjust how arguments are passed in XP Mode. 2. Modify the Script: - You can try modifying the script to handle arguments differently or use alternative methods to retrieve the path of the dropped file. 3. Debugging: - Add some debugging statements to understand how the script is behaving in XP Mode. You can use MsgBox or WScript.Echo statements to display information. 4. Alternative Approaches: - If the issue persists, consider alternative approaches such as using a different method to interact with the clipboard or handling the file path differently. Try making these adjustments and see if they help resolve the issue in XP Mode. If you continue to face problems, feel free to provide more details for further assistance.
 

Solution