Jump to content

Recommended Posts

Posted

I want to create a script that will create a file on the users desktop, regardless of the username/path to the desktop, so that it will work on any windows machine.

I found @DesktopDir in the documentation and it does return the path to the desktop.

However I am having some problems with figuring out how to use @DesktopDir to write a file to the desktop.

I tried a few things, such as:

FileOpen (@DesktopDir"NEW_FILE.txt", 2)
or
$desktop = @DesktopDir
FileOpen(""$desktop"/NEW_FILE.txt", 2)

These did not work for me. Any advice as to how I can have my script create a file on the desktop of any windows machine would be greatly appreciated!

Thanks for any advice or suggestions.

TJ.

Posted (edited)

Get used to using consolewrite or msgbox for troubleshooting your scripts.

And read the help files such as: contents > language reference > operators.

This, I use it often when dealing with weird returns or returns I'm new to.

in this instance a good way to find out the actual problem test the return value of @desktopdir so something like

Consolewrite(@desktopDir &@crlf)

also make sure you run it from inside SciTe

Edited by Attckdog

A true renaissance man

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...