Jump to content

How to preserve string that starts with a number?


dmoc
 Share

Recommended Posts

Hi there! I'm new to AutoIt and trying to create a script to archive my floppies to hd. I simply intend to detect a floppy (done), create a dir on the hd using the floppies label as the dir name and then copy the contents over. I'm stuck with on disk labels starting with a number (eg "3MG758D1"). Only the "3" is being used by "dircreate("C:\floppies\"+$dn)", where "$dn" is the disk name/label. The other problem is the location of the new dir which ends up being in the script dir not the specified path. Any/all help appreciated.

PS: I'm using a hotkey to terminate the script - is this system wide, ie, does it matter which app is in the fg?

Link to comment
Share on other sites

This works for me:

$dn = "test"
dircreate("C:\floppies\" & $dn)
It creates the folders as expexted - not where the script was run from. Use an "&" when concatentating two strings. Use "+" when working with numbers....

Hotkey should work no matter what app is in the foreground.

[size="1"][font="Arial"].[u].[/u][/font][/size]

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...